canopy-enrollment API Reference

For a service integrator (the BFF, canopy-appeals, canopy-renewals, canopy-reporting): canopy-enrollment owns the post-determination SNAP enrollment — the enrollment row, monthly issuance to EBT, issuance history, adverse actions with their appeal stays, and expungement of unused benefits (7 USC §2016(h)(12)©). Tables, indexes and retention: the data-models page; design history: snap-enrollment-ebt, adverse-action-pipeline, household issuances, partial-month retention, and for the expiry sweep, the combined initial allotment and the continuation arm snap-intake-completion.

Base URL

container port 8006 (host: CANOPY_PORT_CANOPY_ENROLLMENT_8006 in .ports.env)

Authentication

Bearer token: a canopy-identity token for this receiver (its aud is urn:canopy:service:canopy-enrollment), authenticated by the service’s identity receiver (ADR-049 Amendment 14): no bearer is 401 token_missing, a token it refuses 401 token_rejected, an X-Canopy-Actor header 400 actor_header_retired, and no trustworthy key set in time 503 keys_unavailable.

Access

canopy-appeals, canopy-eligibility, canopy-renewals, canopy-reporting and canopy-snap hold system edges to canopy-enrollment, and the portal one for the annual summary; every route admits a system caller but the event replay. Worker writes admit the writer bar (schedule and cancel through any client, create and issue through canopy-web), the household-scoped reads caseworker+ behind the #408 household gate, and the listed reads canopy-web’s readers or a service’s onward delegation; canopy-cli holds no edge to canopy-enrollment, and the event replay is user-only admin. A refusal is 403 with its ReceiverDenial code (ADR-049 Amendment 14); each route’s constant is in the authorization inventory.

Database

canopy_enrollment

Admission specifics

  • Household gate (#408, gate_household_actor_access, services/canopy-enrollment/src/api/access.rs) on the four household-scoped reads — the household-issuance list, the annual summary, the continuation history (on the row’s household, after its 404) and the successors read (on the query’s household). A system caller passes and is not audited. A user’s delegation passes with supervisor or admin; otherwise it needs an active household_assignments row in canopy-applications whose worker_id equals its subject byte for byte (#1008), asked on the request’s outbound — the user’s delegation onward, which canopy-applications admits via canopy-enrollment on caseworker+ (ADR-049 Amendment 15) — else 403 with the enrollment.household_issuance.access_denied audit. Every allowed user read stages its allow audit; both audits carry the user’s subject.

  • Ownership. The annual summary requires the portal’s X-Canopy-Applicant claim to bind the household (require_owned_household): 403 ownership_claim_missing / ownership_mismatch.

  • Attribution. Cancel, the stay commands and reopen record sub=<principal.attribution_sub()>; actor=<body actor>: the caller’s canopy subject or its system client id (canopy-appeals sends the stay commands on its system token), beside the body’s display label.

  • The event replay, POST /v1/admin/events/replay, is merged by main.rs from canopy_api::AdminRoutes (crates/canopy-api/src/admin.rs) and admits ADMIN_HUMAN (admin, any client).

Routes

Mounted by routes() in services/canopy-enrollment/src/api/mod.rs; spelling from crates/canopy-contracts-enrollment/src/paths.rs. The last row is the shared operator route main.rs merges from canopy_api::AdminRoutes (crates/canopy-api/src/admin.rs; body ReplayRequest { event_ids }), outside the request-outbound layer.

Route Access Success Coded refusals (RFC 9457 code)

POST /v1/enrollments

system; writer via canopy-web

201 SnapEnrollment

409 live enrollment exists; 422 certification_end_before_start, issuance_due_date_out_of_range (the filing date, else application_date, plus the issuance window leaves the calendar, #2419)

GET /v1/enrollments?household_id=

system; case reader via canopy-web

200 [SnapEnrollment]

—

GET /v1/enrollments/live?household_id=&as_of=

system; writer via canopy-eligibility, canopy-snap

200 LiveEnrollmentView (both enrollment and upcoming null = none; never 404)

400 either parameter absent or malformed

GET /v1/enrollments/{id}

system

200 SnapEnrollment

404

POST /v1/enrollments/{id}/issue

system; writer via canopy-web

201 SnapBenefitIssuance (202 the month’s pending row)

409 (issue guards below)

GET /v1/enrollments/{id}/issuances

system; case reader via canopy-web

200 [SnapBenefitIssuance]

—

GET /v1/enrollments/{id}/continuations

system; caseworker+ (+ household gate)

200 [ContinuationWithAction]

403 gate; 404

GET /v1/enrollments/successors?household_id=

system; caseworker+ (+ household gate)

200 [SuccessorView]

400 household_id absent or malformed; 403 gate

POST /v1/enrollments/{id}/terminate

system

—

410 always (below)

POST /v1/enrollments/expiry-sweep/run

system

200 ExpirySweepRunOutcome / 202 {skipped: true}

—

GET /v1/households/{household_id}/issuances

system; caseworker+ (+ household gate)

200 [SnapBenefitIssuance]

400 bad from/to window; 403 gate

GET /v1/households/{household_id}/annual-summary?year=

system; portal (portal:enrollment:read) + ownership; caseworker+ (+ household gate)

200 AnnualBenefitSummary

403

POST /v1/households/issuances:batchGet

system

200 [HouseholdIssuedSummary]

422 over 500 ids

POST /v1/households/enrollments:batchGet

system; worker reader via canopy-web

200 [HouseholdEnrollmentSummary]

422 over 500 ids

POST /v1/adverse-actions

system; writer

201 AdverseActionView (200 on key replay, ahead of every refusal)

400 earlier date; 409 open action / tombstone / non-terminable / key used for another enrollment; 422 no head, source_not_claimable_over_http, reduction_requires_proposed_amount, target_end_not_claimable_over_http

GET /v1/adverse-actions

system; case reader via canopy-web

200 page

—

GET /v1/adverse-actions/{id}

system; writer via canopy-web, canopy-appeals

200 AdverseActionView

404

POST /v1/adverse-actions/{id}/cancel

system; writer

200

404; 409 adverse_action_household_mismatch, enacted / vetoed; 422 missing household_id or unknown body field

PUT /v1/adverse-actions/{id}/stays/{appeal_id}

system; writer via canopy-appeals

200 StayReceipt

409 (stay machine below)

GET /v1/adverse-actions/{id}/stays/{appeal_id}

system

200 StayReceipt

404 no link

POST /v1/adverse-actions/{id}/reopen

system

201 AdverseActionReopenView (200 replay)

400 future receipt; 409 not enacted / successor / raced; 422 wrong source

POST /v1/adverse-actions/enact-sweep

system

200 EnactSweepReport

—

POST /v1/admin/events/replay

admin

200 ReplayReport

403

Access legend: system = any system caller but the portal; portal (<scope>) = the portal’s system token holding that scope; writer = a user’s delegation holding a CASEWORKER_WRITER_ROLES role; caseworker+ = CASEWORKER_OR_ABOVE_ROLES; case reader = CASE_READER_ROLES; worker reader = WORKER_READER_ROLES (all crates/canopy-auth/src/roles.rs); a bar with no client admits a delegation through any client, via X, Y only a delegation those clients present; + household gate and + ownership are the checks above.

Enrollments

Create. CreateEnrollmentRequest — household_id, determination_id, application_id, certification_start_date, certification_end_date, monthly_issuance_amount, expedited, application_date, optional legal_filed_date. initial_issuance_due_date = legal_filed_date.unwrap_or(application_date) + [snap.issuance].{expedited_days | standard_days} (7 and 30 in the Georgia ruleset — 7 CFR 273.2(i)(3), 273.2(g)(1)); the event path shares the rule. One live enrollment (pending_issuance / active / suspended) per household is structural — the partial unique snap_enrollments_one_live_per_household (migrations/20260801000000_one_live_enrollment_per_household.sql) answers 409; an end before the start is 422 before any write.

Live read. GET /v1/enrollments/live?household_id=&as_of= (both required, as_of a YYYY-MM-DD date) — canopy-eligibility’s fail-closed classifier read and canopy-snap’s overpayment-recompute participation read (#936, the pre-establishment claim floors; also fail-closed) (store::live_enrollment_on): the household’s ONE row under the live predicate (active = true AND status IN ('pending_issuance', 'active', 'suspended') — peek_live_enrollment_id's SQL) whose certification_end_date >= as_of, as LiveEnrollmentView { enrollment: SnapEnrollment | null, upcoming: SnapEnrollment | null }. A row whose period covers as_of (certification_start_date ⇐ as_of) is enrollment. A row whose period starts after as_of (an approved enrollment that has not started) is upcoming, with enrollment: null (#2339): canopy-eligibility’s order arm continues it, and nothing reads it as participation on as_of. The one-live fence (#1130) means at most one of the two is set. An expired-but-unswept row (end before as_of) and a terminated / expired / fenced-out row read both null; that is a 200, never a 404, so the classifier tells "no live row" from a transport or parse failure. A body without upcoming parses as upcoming: null. A system caller, or canopy-eligibility’s or canopy-snap’s onward delegation on the writer bar; no portal arm.

Issue. IssueBenefitsRequest { benefit_month } (first of the month). Refusals in order, all row-free: enrollment_not_issuable (status not pending_issuance / active); benefit_month_after_certification_end; benefit_month_before_certification_start; covered_by_combined_allotment (also when the combined allotment commits between that check and the insert: the snap_issuances_no_overlapping_coverage belt refuses the row and the path answers the same code); benefit_month_already_issued; benefit_month_covered_by_household (another enrollment of the household holds the month); initial_month_under_floor (the anchor month prorates under the federal snap-procedure.json issuance.initial_proration_minimum_cents, 7 CFR 273.10(a)(1)(iii)); issuance_fence_tripped (the lifecycle_revision fence moved mid-issuance — the EBT transfer stays or returns to pending for reconciliation). The pending row is written (autocommitted) before the EBT call, under a fresh issuance id that is the EBT idempotency key, holding the settle lease (settle_claimed_at, #2664): the settlement pass never drives the row while this request’s EBT call is in flight (it reports the row lease-skipped), so with no lifecycle transition the request’s fenced mark lands it, clears the lease and answers 201 issued whatever the settlement ticks do. When the call fails, or the request dies after the write, the row stays pending under the lease and the settlement pass re-drives it under that id once the lease lapses (ten minutes); the expiry sweep never cancels it while the lease lives. A refusal computed before this request writes its row (every refusal above except issuance_fence_tripped, which follows the write) is answered only when the month holds no pending regular issuance of this enrollment; when it does (a retry of a request whose EBT call failed, or a month still settling, whichever request or the event path wrote the row), the answer is 202 with that row, so the caller learns the issuance id instead of benefit_month_already_issued (#2657). The 202 is given only while the settlement pass will drive the row: for an enrollment that is not issuable, or a month outside its certification window, enrollment_not_issuable and the window refusals stand. An issued or settled month still answers benefit_month_already_issued. The row carries combined / benefit_months_covered for a 7 CFR 274.2(c) combined initial allotment, which only the event path mints.

Settlement. The auto-enroll subscriber creates the first issuance pending inside the inbox transaction; the advisory-locked canopy-enrollment.issuance-settlement pass (5 s tick) drives the EBT call outside any transaction and lands the lifecycle_revision-fenced mark + first-issuance activation in one short transaction, stamping expiry_date = issuance day + [snap.issuance].expungement_days and ebt_accepted_on / ebt_transaction_id when the processor accepted a transfer whose landing fence-tripped. A pending row on a terminated or suspended enrollment is never auto-settled; the hourly aged-pending alert names it.

Expungement. The daily canopy-enrollment.scheduler pass (src/expungement.rs) notices, then expunges, issued rows (7 USC §2016(h)(12)©; 7 CFR 274.2(i)). Since #2407 the advance notice is a precondition of expungement (7 CFR 274.2(i)(2); compliance/action-catalogue/snap.toml snap.issuance.expungement-advance-notice). A row is noticed once its expiry_date is within [shared.timing].expungement_advance_notice_days, or as soon as it is past expiry without a notice (a late notice). Should two passes run at once, the first notice is staged under the row lock and only while the row has no event id (store::lock_unnoticed), so one pass stages the letter and the other counts the row in expunge_unchanged (#3172); the lock also requires the expiry_date the pass read, so a row an EBT activity moved meanwhile is not noticed with its old date but counts in expunge_unchanged, and the next pass reads its new date (#3173). The notice’s stated removal date is the later of expiry_date and the staging day plus the window. A row past expiry_date is expunged only after canopy-notices has dispatched its letter (expungement_notice_dispatched_on, stamped from notice.dispatched) and the pass day is after the later of expiry_date and the dispatch day plus the window, so a notice dispatched on the window’s first day expunges the day after expiry_date, as before. A row with no dispatched notice is HELD, never expunged: every pass logs a WARN naming the issuance and the reason (never_noticed when no notice was staged, notice_not_dispatched while the letter has not gone out, notice_restaged while a re-staged letter has not gone out) and counts it in expunge_held. When the letter exists but its dispatch failed, a canopy-notices resend (POST /v1/notices/{id}/resend) dispatches it, and that dispatch releases the hold. A late-noticed row waiting out its window counts in expunge_deferred. The expunge write itself re-asserts a dispatched notice.

Re-notice (#2423). A letter canopy-notices never generated (recipient resolution failed, so no notice row exists, a resend has nothing to send and a replayed event is deduplicated) would hold its row forever. So when a held row’s notice is still undispatched more than [shared.timing].expungement_renotice_after_days after its staging day (expungement_notice_staged_on), the pass re-stages it, logs a WARN with reason = notice_past_bound and counts it in notices_restaged (renotices_failed when the re-stage fails; the next pass retries it). Under the row lock, and only while the row still carries the notice the pass read (store::lock_undispatched_notice), it stages a fresh enrollment.expungement_pending under a new event id, stating a removal date the full window from that day, and stamps the new id, the staging day and expungement_notice_restage_count + 1. A pass that loses the lock to another pass, a dispatch or an activity counts the row in expunge_unchanged. The old event id no longer matches the row, so the superseded letter’s dispatch, a resend of it included, releases nothing: only the re-staged letter’s dispatch does, and the window runs from its dispatch day (7 CFR 274.2(i)(2)), so the household has the full window after the re-staged letter goes out. A household canopy-notices still cannot address is re-staged once per bound until canopy-persons holds a usable mailing address for the recipient (services/canopy-notices/src/recipient.rs) or, for a never_noticed row, its enrollment names a head. No operator edit of the notice columns is needed.

Held gauge (#2423). Every replica samples the held rows once a minute into the gauge canopy_enrollment_expungement_held{reason}, with the four WARN reasons as labels (expungement::spawn_held_metrics), so a dashboard reads the database whichever replica ran the daily pass, and a dispatch that releases a row shows within a minute. notice_past_bound counts rows the next pass will re-stage. The alerts on it are in Deployment Guide › Alerting.

Expungement approach (#1744). The pack designates its 7 CFR 274.2(i)(1) approach in snap.issuance.expungement_approach. Under unused_benefits, (i)(1)(ii), a row expires expungement_days after its issuance, whatever the account does. Under inactive_account, (i)(1)(i), EBT account activity moves the date: on ebt.account_activity.observed (below), every unexpunged issued row of the account whose expiry_date is earlier than the activity day plus expungement_days moves to that date, and its notice columns are cleared, so the pass notices it again before the new date. The expunge write also re-asserts expiry_date < today, so a row an activity moves while the pass runs matches nothing and counts in expunge_unchanged. A row expunged under inactive_account whose account has no activity observation counts in expunged_unobserved, logs a WARN once per pass and increments canopy_enrollment_expunged_without_activity_observation_total: until the activity feed is connected (#1553/24), every account ages from issuance.

Terminate. Direct termination was removed: a termination is an adverse action (7 CFR 273.13; PAMMS 3705). The route stays registered and answers 410 with that explanation.

Batch and household reads

  • GET /v1/households/{household_id}/issuances — optional from=YYYY-MM + to=YYYY-MM (both or neither), include_all=true adds the non-issued rows (pending / cancelled, and failed once #1553 writes it). A combined row is listed when either covered month is in the window; per-month readers split it through SnapBenefitIssuance::covered_months.

  • POST /v1/households/issuances:batchGet { household_ids, benefit_month } — the issued aggregate per unique id for one month (issued_total, issuance_count; an honest zero, never a dropped entry); no enrollment-status predicate ("issued is issued"). POST /v1/households/enrollments:batchGet { household_ids } — each household’s newest live enrollment (status, monthly_issuance_amount; null when none). Both cap at 500 ids, collapse duplicates, keep request order, and audit nothing.

  • GET /v1/households/{household_id}/annual-summary?year= — total_issued + per-month months for issuance_status = 'issued' rows (expunged included); an unknown household is a 200 with "0".

  • GET /v1/enrollments/{id}/continuations — enrollment_continuations rows newest first, each { continuation: ContinuationView, adverse_action: AdverseActionView | null } (classification ∈ immediate | reduction_staged | extend_now_reduce_later | termination_staged | no_change; status ∈ applied | staged | partially_applied | superseded | vetoed | cancelled). A user’s allowed read stages enrollment.continuations.read.

  • GET /v1/enrollments/successors?household_id= (api/successors.rs) — the household’s snap_enrollment_successors rows, newest decision first: { renewal_application_id, determination_id, decision: approved | denied, status: scheduled | withdrawn | landed | superseded_by_live_row | refused, benefit_effective_date, certification_end_date?, enrollment_id?, updated_at } — one per renewal application whose in-period recertification decision was signed under recert_approval. The same access as the continuations read (a system caller or a caseworker+ delegation, then the #408 gate on the QUERY’s household; a household with none is an empty list). A user’s allowed read stages enrollment.successors.read.

Adverse actions

  • Schedule POST /v1/adverse-actions: policy terms (advance days from [notices], CB availability, the policy version) are snapshotted onto the row; default effective date = legal today + advance days, and a caller date may only push later. One open action per enrollment; idempotency_key replays the same action. Once the request’s shape resolves the source triple (the worker key, or the claim), the triple decides (#2453): under the triple’s advisory lock (a periodic-report claim’s is its trigger lock), an action the triple already created is answered 200 as it now stands (enacted, cancelled, or with an effective date a later legal day would refuse) before any terminable, effective-date or tombstone check, so a retry is never refused by its own first request’s action and a concurrent same-triple pair yields one action and one replay. A triple first used for a different enrollment is still refused 409. A source claim (created_source = periodic_report, source_reference = the certification id) creates it under the claimant’s idempotent triple; its cb_available is the reason row’s, as for any action (#2212: both periodic-report rows, periodic_report_nonfiling and periodic_report_verification_failure, carry false; no override on the source). The frozen cb_rule cites no manual for a row without CB or an exempt action; a mass-change action (#806) freezes the pack’s [snap.adverse_action].mass_change_cb_rule and records mass_change_exemption_authority as its exemption authority. A reduction carries proposed_benefit_amount and, from in-process staging only, target_certification_end_date. A member_sanction (#3219) is staged in process only (over HTTP it is 422 member_sanction_not_claimable_over_http): it carries proposed_benefit_amount, never a target end, and names the sanctioned member (person_id), the canopy-snap finding (sanction_ref), its violation_number and the last day of its minimum period (minimum_period_ends_on).

  • Read the cursor-paginated list (after_id, household_id, open=true) or one action; both carry active_stays and the provenance triple.

  • Cancel { household_id, actor, reason? } (CancelAdverseActionRequest) releases every stayed link atomically; idempotent on an already-cancelled action. household_id is required (422 before admission if missing): under the row’s FOR UPDATE lock, an action whose stored household_id is not the body’s is refused 409 adverse_action_household_mismatch before the status check (#3105), naming the path id and the requested household, never the stored owner, with nothing written and no event staged. The check holds the stored owner to the household the request names; a caller that names the action’s own household passes. canopy-web binds the action to the worker’s household before sending that household (canopy-web API).

  • Stay machine PUT …/stays/{appeal_id} { "command": "stay" | "restay" | "release" | "veto", "actor" } → StayReceipt { link_status, active_stays, action_status }. A new stay is refused against a non-scheduled action; veto moots a still-scheduled action durably; restay is the one legal released → stayed transition (a timely final appeal); replays of a terminal state return the stored state. canopy-appeals calls it at filing time and reads the link back through the GET.

  • Reopen { received_date, actor } un-terminates the enrollment an enacted periodic_report-sourced action closed (canopy-renewals validates the 30-day window and calls here); received_date is the proration anchor for the receipt month, lifecycle_revision is bumped, the action row stays enacted.

Sweeps

  • Enact (POST /v1/adverse-actions/enact-sweep; also the hourly loop): every claimed due action passes the gate — zero active stays, dispatch evidence for the current window — the dispatched notice version whose noticed effective date covers the action’s floor, chosen by window and never by arrival order (#2461) — (dispatched_date ≤ noticed_effective_date − required_advance_days; exempt actions need a dispatched adequate notice), inside the enact window. Pass ⇒ terminated on the noticed legal date with PAMMS 2415 partial retention; fail ⇒ a successor legal window + operator alert. Claims are FOR UPDATE SKIP LOCKED batches, so concurrent passes share the cohort; always 200 with the typed report.

  • Expiry (POST /v1/enrollments/expiry-sweep/run; the daily canopy-enrollment.expiry-sweep leg): a live enrollment whose inclusive certification_end_date is before legal today moves to expired — pending issuances cancelled (an entitled month is a WARN-logged 7 CFR 273.17 restoration candidate), lifecycle_revision + 1, still-scheduled actions cancelled with enrollment_expired, enrollment.expired staged in the same transaction — and when the household’s DENIED in-period renewal left a withdrawn successor for the day after that end, the denial’s snap.case_closed (closure_date = end + 1, the denial’s reason, the expired row’s head of household) in the same transaction. After the scan the pass lands every scheduled successor whose start day has arrived (successors::land_due_successors), each in its OWN transaction under the household advisory lock: a live row already on the household → superseded_by_live_row (the day-of race with an interactive approval); else the stored approval through the ordinary validate_for_enrollment + create_from_inputs path — a FULL first month, no proration, no initial-month floor (7 CFR 273.14(e)(1)) — → landed; a create that no longer passes (born-expired after an outage) → refused with the reason, WARNed as a 7 CFR 273.17 restoration candidate — the expiry before it stays committed. The report carries successors_landed / successors_superseded / successors_refused. The hourly fenced tick’s window is keyed on the LEGAL day (run_window_fenced_until_complete), so the first probe after legal midnight of a start day expires the old row and lands the new one. A pass in which a row’s expiry or a successor’s landing failed, or which stopped at its time budget, releases that window, so the next hourly probe runs it again, the same legal day unless the day has run out of probes (#2433); a row that fails on every pass is retried hourly. A WARN alone (a refused successor, an entitled month) does not release the window. 202 { skipped: true } when another invocation holds the advisory lock.

Benefit proration

A mid-month effective date prorates (monthly_amount / days_in_month) * remaining_days, the days counted as the pack's [snap.issuance].proration_month says (7 CFR 273.10(a)(1)(ii), #1742: standard_30_day counts every month as 30 days and treats the 31st as the 30th; exact uses the calendar month; a missing or unknown value refuses boot), rounded per [snap.issuance].proration_rounding (floor_whole_dollar, 7 CFR 273.10(a)(1)(ii)). The base figure is the benefit month’s own price when the enrollment carries a benefit_month_prices schedule, else monthly_issuance_amount. Two anchors share issuance::prorate_month_from: the initial month (benefit_effective_date, falling back to application_date on HTTP-created rows) and a periodic-report reopen’s received_date. An initial month under the initial_proration_minimum_cents floor is refused initial_month_under_floor; a reopen month is never suppressed.

An adverse action is not enacted after the issuance cycle it was noticed for has ended; it is repaired with fresh dates instead. The cycle is the pack's [snap.issuance].cycle_granularity (benefit_month: the window closes on the last day of the noticed month; a missing or unknown value refuses boot).

Error codes

Code Meaning

400

Invalid body; benefit_month not the first of a month; a bad YYYY-MM window on the household-issuance read; household_id or as_of absent or malformed on the live read; an adverse-action effective date earlier than the default; a reopen receipt in the future; an X-Canopy-Actor header (actor_header_retired)

401

No bearer (token_missing) or a token the receiver refuses (token_rejected)

403

Admission: portal_on_non_portal_route, portal_scope_missing, service_class_on_user_only (a system caller on the event replay), system_caller_required, actor_not_allowed, required_role_missing; ownership on the annual summary: ownership_claim_missing, ownership_mismatch; the household gate refused the user (enrollment.household_issuance.access_denied audited)

404

Enrollment, action, or stay link not found

409

Issue guards: enrollment_not_issuable, benefit_month_after_certification_end, benefit_month_before_certification_start, covered_by_combined_allotment, benefit_month_already_issued, benefit_month_covered_by_household, issuance_write_raced (another issuance for the household was being inserted at the same moment and the database ended this one as a deadlock; nothing was written, retry; #1747), initial_month_under_floor, issuance_fence_tripped; a second live enrollment; a second open action; adverse_action_household_mismatch (an adverse-action cancel whose household_id is not the action’s, #3105); cancel of an enacted / vetoed action; stay-machine refusals; reopen of a non-enacted action, a household with a successor enrollment, or a raced twin

410

Direct terminate (removed)

422

certification_end_before_start, issuance_due_date_out_of_range; source_not_claimable_over_http, reduction_requires_proposed_amount, target_end_not_claimable_over_http; an adverse-action cancel body without household_id (#3105); a :batchGet over 500 ids; an enrollment without head_of_household_person_id; a reopen outside the periodic_report source

503

No trustworthy key set in time (keys_unavailable)

Events published

String set from crates/canopy-contracts-enrollment/src/events.rs and services/canopy-enrollment/src; every envelope asserts programs = ["snap"].

  • enrollment.created, enrollment.benefits_issued — the create and issue paths.

  • enrollment.adverse_action_scheduled (AdverseActionScheduledV1: action id, provenance triple, recipient, verbatim effective_date, action_type ∈ termination | reduction | member_sanction, action_reasons, cb_available, for a reduction proposed_benefit_amount / target_certification_end_date, and for a member_sanction (#3219) proposed_benefit_amount, sanctioned_person_id, sanction_ref, violation_number and minimum_period_ends_on; person_id stays the notice's recipient) — at schedule time and for every successor legal window. Consumer: canopy-notices.

  • enrollment.adverse_action_terminated (AdverseActionTerminatedV1, staged with the enact writes), enrollment.adverse_action_vetoed (veto_source ∈ stay_command | appeal_reversal), enrollment.adverse_action_cancelled (reason + actor; periodic_report_completed is the benign supersession) — consumed by canopy-renewals' periodic-report consumer.

  • enrollment.adverse_action_enacted (AdverseActionEnactedV1, non-terminating enactments — reductions) — audit and SSE only.

  • enrollment.continuation_applied (ContinuationAppliedV1, applied_via ∈ immediate | adverse_action_enacted, optional supplement, and since #1703 the optional certification_category — the row’s assigned category, the code of a [[snap.certification.categories]] row of the signing pack (georgia standard | elderly_disabled | senior | abawd), omitted when None; since #2209 not a closed set: validate (check_certification_category) refuses only a malformed token (^[a-z][a-z0-9_]{0,63}$, never expedited), the continuation arm refuses an inbound token outside the codes canopy-enrollment loaded from ITS pack as an ArmDefect (dead-lettered, never applied), and canopy-renewals refuses an in_cert_conversion without one) and enrollment.continuation_terminated (ContinuationTerminatedV1) — consumers: canopy-renewals' adjuster, canopy-notices (benefit-continuation on immediate), canopy-security.

  • snap.case_closed (SnapCaseClosedV1, the continuation termination tail’s Medicaid ELE signal, once at enactment).

  • enrollment.expired (EnrollmentExpiredV1: the inclusive end, expired_at, the cancel tallies) — audit and the worker portal only; canopy-renewals does not consume it.

  • enrollment.expungement_pending — the advance expungement letter’s trigger (removal_date, allotment_amount), fired [shared.timing].expungement_advance_notice_days before expiry. Since #2388 it carries person_id, the letter’s recipient: the head of household of the issuance’s enrollment (head_of_household_person_id). An issuance whose enrollment names no head is not noticed: the daily pass counts it failed with a WARN, leaves it unstamped and retries it on every pass; past expiry it is held, not expunged. Since #2407 removal_date (named expiry_date until #2422) is the removal date the letter states (the issuance’s expiry date, or for a late notice the staging day plus the window), and the envelope id is stamped on the row as expungement_notice_event_id. Since #2423 the pass stages it again, under a fresh envelope id, for a held row whose notice stayed undispatched past [shared.timing].expungement_renotice_after_days (Re-notice, above).

  • enrollment.household_issuance.read / .access_denied, enrollment.continuations.read, enrollment.successors.read — the household-gate audit pair and the continuation-read and successors-read allow audits (ids and role tokens only). Each is in canopy-enrollment’s broker write ACL; the successors-read audit was missing from it until #2916, so the broker refused it.

Events consumed

  • determination.completed.snap — auto-enrollment (the initial-month proration rule and the combined initial allotment on an expedited_postponed basis; producer-contract violations go to the DLQ) and, on a continuation-class basis (in_cert_conversion, interim_change, order_continuation, mass_change_cola — CONTINUATION_CLASS_KINDS), the continuation arm (immediate applies in place with the 273.12(c) supplement, reconciled as entitlement(month) − money already attributed to the month over regular and supplemental rows (continuation/supplement.rs); extend_now_reduce_later, reduction_staged, termination_staged stage a continuation-sourced action whose effective_date is the later of the determination’s benefit_effective_date and the 273.13 notice floor — today itself for a mass_change_cola, which stages advance-notice EXEMPT (7 CFR 273.13(b)(1): exempt_from_advance_notice, exemption_authority = "7 CFR 273.13(b)(1); PAMMS 3705:57", exemption_actor = "system:canopy-enrollment") with cb_available kept from its reason row under cb_rule = "CB on a misapplication claim (7 CFR 273.12(e)(6); PAMMS 3705)" (adverse_actions.rs freeze_policy; the enact gate then needs only a dispatched adequate notice) — under the kind family’s reason pair (continuation/arm.rs reason_codes): continuation_benefit_reduced / continuation_ineligible for the conversion, change_benefit_reduced / change_ineligible for the two re-determination kinds, mass_change_benefit_reduced / mass_change_ineligible for the COLA; canopy-notices letters the (created_source = continuation, mass_change_*) scheduled event as mass-change-reduction / mass-change-termination (a 273.12(e)(1)(ii) mass-change notice, never the advance NOA); no_change records the row). For interim_change / order_continuation / mass_change_cola the payload’s carried certification_end_date (and the signed expiration_date) must be the live row’s end — a mismatch is the typed CertificationPeriodMismatch DLQ before any write. A duplicate live enrollment from a non-continuation approval parks until the expiry sweep flips the stale row; a continuation-class determination for a household WITHOUT a live enrollment — the COLA included — is the arm’s NoLiveEnrollment DLQ (enroll_guards.rs keeps only the born-expired refusal; the #1635 COLA park is gone with #806). A recert_approval decision — approved OR denied (successors::handle, routed before the continuation split) — is never inserted on arrival and never parks: under the household advisory lock and causal::supersedes against the renewal application’s row (determination_id, determined_at), a newer approval (validated through the whole enrollment belt, recert_facts included: benefit_effective_date == renewal_certification_end_date + 1 == effective_date) is scheduled with its payload stored; a newer denial is withdrawn — with NO live row the case closes at once (snap.case_closed, closure_date = legal today, the first denial_reason_codes entry or unspecified), with one the closure waits for the expiry; an older or equal arrival is acked unchanged (successor_stale_arrival). A second renewal application while one is scheduled, a NEWER decision on a settled (landed / superseded / refused) row (an older or equal one is the stale ack above), a missing renewal application id or scoring instant, and a mis-anchored approval are typed DLQs.

  • renewal.snap_periodic_report_processed (queue canopy-enrollment.events) — records the per-(certification, generation) completion tombstone and cancels a still-scheduled matching periodic_report action with periodic_report_completed.

  • notice.generated / notice.dispatched — order-independent evidence stamps onto adverse_action_notices (the enact gate’s dispatch evidence). The work-item key either carries (source_event_id + notice_type; absent or null keys are fine) is recorded on the version and supersedes a stale sibling awaiting its regeneration (#2459); a present but unparseable source_event_id nacks. Since #2407 every notice.dispatched whose source_event_id matches a row’s expungement_notice_event_id stamps that row’s expungement_notice_dispatched_on from dispatched_date (first dispatch wins), releasing its expungement hold. A matching dispatch without a parseable dispatched_date, or an unparseable source_event_id, nacks to the DLQ.

  • notice.stale (#2459; payload canopy_contracts_notices::events::NoticeStaleV1) — canopy-notices retired an action letter whose legal day passed before dispatch (#2447), so it can never be the operative letter. With regenerating = true a letter regenerated from the same work item follows: the version stays a staged successor, so the repair gate answers PendingEvidence in the gap instead of minting a second letter, and it is marked awaiting_regeneration; the first version recorded with the same work-item key (source_event_id + notice_type, carried by notice.dispatched and, from the #2459 producer, notice.generated) that is not itself awaiting supersedes it — at once if one is already recorded. With regenerating = false (no work item, or canopy-notices' re-announcement after the regeneration failed terminally) the version is superseded now, so the gate can repair; supersession is monotonic, so a late regenerating = true never revives it. Arriving before the letter’s notice.generated, it creates the version row, and the late generated event no-ops. A dispatched version is never touched. A letter bound to no action is skipped; a malformed payload, or an action letter without its noticed effective date, nacks to the DLQ.

  • ebt.account_activity.observed (#1744; payload canopy_contracts_enrollment::events::EbtAccountActivityObservedV1) — EBT account activity from the rail; canopy-exchange publishes it from the processor’s inactive-accounts file under #1553/24, and this consumer lands first. It upserts snap_ebt_account_activity, keeping the later last_activity_on. Under inactive_account it then moves the account’s unexpunged rows as Expungement approach describes; under unused_benefits no date moves. A row already expunged is never reinstated (7 CFR 274.2(i)(3)); each one the activity would have moved increments canopy_enrollment_ebt_activity_after_expunge_total, the input to the reconciliation against the processor’s expunge file. A malformed payload, an unknown source included, nacks to the DLQ.

  • appeal.decision_recorded / appeal.withdrawal_finalized — a reversal vetoes durably; an agency-favorable decision with a recorded CB cessation reschedules the action to the next cycle under adequate notice; a finalized withdrawal releases the stay and runs the gate.

Work sanction (#3219)

A determination.completed.snap under the work_sanction basis (continuation class) takes the continuation arm like an order_continuation, with three differences (continuation/arm.rs). A lower allotment stages a member_sanction instead of a reduction, under the work_sanction_member_excluded reason, with timely notice: its effective date is the later of the basis's anchor (the sanction's first day) and legal today plus [notices].advance_notice_days. A denial (every member sanctioned) stages a termination under work_sanction_ineligible. The event must carry the finding's work_sanction terms; one without them is a DLQ (WorkSanctionTermsMissing). A higher allotment on a lift applies immediately, as every continuation increase does. At maturation the enact gate runs the reduction tail for a member_sanction: the noticed amount re-prices the live row in place, the period is kept, the pending issuances are re-minted from the enacted month and the row stays live. Nothing marks the enactment final, so a later lift's order re-prices it back. The issuance lock taken before the enrollment row now covers every action that re-prices (ActionType::reprices). A newer determination for the household before maturation (an interim change, say) cancels the staged member_sanction like any staged continuation action; the enrollment.adverse_action_cancelled it stages names the finding (sanction_ref), and canopy-snap re-stages the sanction's order from it, so the sanction still takes effect (canopy-snap API).

Edit this page · default