canopy-notices API Reference

For a service integrator wiring a letter, and a BFF author reading one: canopy-notices generates, stores and dispatches household notices as PDFs from Typst templates (ADR-010) and, per ADR-029, renders any allow-listed non-NOA document with an optional ES256 detached-JWS signature. Most letters are not requested over HTTP: they are routed from bus events through the ruleset’s notices/manifest.toml (below). Tables and retention: the data-models page.

Base URL

container port 8008 (host: CANOPY_PORT_CANOPY_NOTICES_8008 in .ports.env)

Authentication

Bearer token: a canopy-identity token for this receiver (its aud is urn:canopy:service:canopy-notices), 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

No client but the portal holds a system edge to canopy-notices, and no route has a system arm: the applicant reads admit the portal (bound by its ownership claim) and canopy-web’s readers; the read stamp is the portal’s alone; the render route admits the citation-render bar through any client (canopy-web or canopy-cli); generate and resend admit admin, and the delivery queue caseworker+, only through canopy-cli; 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_notices

Admission specifics

  • Ownership. The portal’s X-Canopy-Applicant claim must bind the household (require_owned_household): on GET /v1/notices against the household_id filter (an absent filter never binds), answered 403 ownership_claim_missing / ownership_mismatch; on GET /v1/notices/{id}, its PDF and mark-read against the stored notice’s household after the load, answered with a uniform 404 so a refusal never confirms a foreign notice exists. The check is inert for a user.

  • The admissions are OPERATOR (admin via canopy-cli), QUEUE_READER (caseworker+ via canopy-cli) and the inline render and mark-read admissions in services/canopy-notices/src/api/ beside the three delegated::NOTICES_* rows; no route records an actor. The event 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-notices/src/api/mod.rs; spelling from crates/canopy-contracts-notices/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 }).

Route Access Success Coded refusals

POST /v1/notices

admin via canopy-cli

201 Notice

400 unknown (program, template_key); 500 render/storage failure (nothing stored)

GET /v1/notices

portal (portal:notices:read) + ownership; worker reader via canopy-web

200 NoticePage

422 unknown program / programs slug

GET /v1/notices/queue

caseworker+ via canopy-cli

200 [Notice]

—

GET /v1/notices/{id}

portal (portal:notices:read) + ownership; worker reader via canopy-web

200 NoticeWithAppealRights

404

GET /v1/notices/{id}/pdf

portal (portal:notices:read) + ownership; worker reader via canopy-web

200 application/pdf

404 (unknown notice, or the on-demand re-render failed); 409 notice_template_version_unavailable (the re-render would need a template version the manifest no longer carries)

POST /v1/notices/{id}/mark-read

portal (portal:notices:ack) + ownership

200 Notice

404

POST /v1/notices/{id}/resend

admin via canopy-cli

200 Notice; 202 Notice (stale: regenerating)

400 no PDF to deliver; 404; 409 superseded (retracted) notice, or a stale notice that cannot regenerate

POST /v1/documents/render

citation render

200 application/pdf (+ X-Canopy-Signature)

400 unknown template_key

POST /v1/admin/events/replay

admin

200 ReplayReport

403

Access legend: portal (<scope>) = the portal’s system token holding that scope; + ownership = the claim check above; worker reader = a user’s delegation holding a WORKER_READER_ROLES role; caseworker+ = CASEWORKER_OR_ABOVE_ROLES; citation render = CITATION_RENDER_ROLES (admin, studio_admin, auditor; all crates/canopy-auth/src/roles.rs); a bar with no client admits a delegation through any client, via X only a delegation that client presents.

POST /v1/notices

Request GenerateNoticeRequest:

{
  "household_id": "uuid", "recipient_person_id": "uuid",
  "notice_type": "notice_of_action", "subject": "SNAP Benefits Approved",
  "template_key": "noa-approval", "regulatory_basis": "7 CFR 273.10",
  "program": "snap", "application_id": "uuid", "determination_id": "uuid",
  "effective_date": "2026-04-01", "continued_benefits_available": false,
  "program_data": { "monthly_allotment": "535.00", "effective_date": "2026-04-01", "expiration_date": "2026-09-30" }
}
  • Required: household_id, recipient_person_id, notice_type, subject, template_key, regulatory_basis. Optional: program, application_id, determination_id, effective_date, continued_benefits_available, program_data, and the adverse-action binding adverse_action_id, adverse_action_generation, action_reason_code, exemption_authority, effective_date_policy.

  • notice_type is an opaque string on the wire (notice_type: String in crates/canopy-contracts-notices/src/notices.rs), persisted as-is; the routed vocabulary is the manifest’s notice_type values (table below). template_key is a bare manifest key resolved as templates[program][template_key] (canopy_typst::Manifest, crates/canopy-typst/src/manifest.rs); a pair with no entry is 400.

  • effective_date_policy is clamp (default — an effective date earlier than notice_date + advance_notice_days is pushed to the floor and the row marked advance_notice_adjusted; [notices].advance_notice_days is refused at boot outside 1..=366, #2425) or verbatim (the adverse-action pipeline computed the legal date; the notice persists it untouched).

  • program_data is an opaque serde_json::Value handed to the template; the required keys are per template.

  • A render or upload failure fails the request — a notice never persists without its PDF. The HTTP path renders the placeholder recipient block; event-routed letters resolve the real recipient (below).

  • Response Notice carries pdf_storage_path, delivery_status (pending until the dispatcher stamps dispatched_at), the action binding, cb_election_deadline (notice_date + [appeals].continued_benefits_election_days), acp_applied (the address-confidentiality substitute block rendered — the DM page’s ACP section), and agency_name / agency_phone: the letterhead the notice printed (#2389), null when the generator recorded none (an older or seed-loaded row, which printed [notices]). The applicant portal names them as a withheld letter’s contact (#2400). notice_date and dispatched_at derive from the gated clock in [jurisdiction].timezone.

GET /v1/notices

Keyset-paginated newest-first (created_at DESC, id DESC). Query: household_id, program, repeated programs, limit (default 50, max 200), after_created_at + after_id (the previous page’s next_cursor). The two program filters compose by AND; an unknown slug is 422 naming the value. Response NoticePage — items + next_cursor (null at the end).

Reads, mark-read, resend, queue

  • GET /v1/notices/{id} → NoticeWithAppealRights (the appeal filing deadline). appeal_rights is present exactly when the letter prints the hearing-rights box, its template’s hearing_rights (Template resolution, #2431); a letter without the box (the interview appointment, the NOMI, the verification checklist, …) and a program-less notice, which renders no letter, read null. GET /v1/notices/{id}/pdf streams the object from canopy-store; a notice with no stored PDF (or whose object cannot be read) triggers an on-demand re-render whose bytes are returned without being persisted. The re-render prints the letterhead, appeal rights and program data the notice recorded. Only a notice with no recorded letterhead or no appeal-rights row takes the current [notices] for those fields, a re-render without a snapshot prints the placeholders for its program data, and no re-render reads a [notices.program.<program>] table (Notice identity).

  • A stale notice (#2447) and a superseded one (#2456) are retired (active = false): GET /v1/notices/{id}, its PDF and mark-read answer 404, and GET /v1/notices omits it, so the applicant portal and the worker lists show no letter that was never mailed — after a regeneration, only the regenerated letter and its appeal rights. A resend still resolves a retired notice (see below).

  • POST /v1/notices/{id}/mark-read sets read_at on first open (COALESCE(read_at, now()), idempotent). No audit event — the applicant’s own read.

  • POST /v1/notices/{id}/resend flips delivery_status back to pending for the dispatcher loop: it retries a failed notice and mails a dispatched one again. A resent copy keeps the notice’s first dispatched_at, the mailing its legal windows count from; its hand-off is stamped as last_resent_at and republished on notice.dispatched as resent_at (#2458). A resent copy that exhausts its attempts — refused to the bound, or parked by the crash-loop guard — returns the notice to dispatched, not failed: the original letter went out, and only the copy’s failure is logged, at ERROR (#2462). A retracted letter is refused with 409 (#2446): a superseded notice, or one whose retraction arrived while it was leased or after it went out. The resend takes the retraction consumer’s source-event lock, so a racing retraction is either refused here or finds the resend committed; a retracted notice is never revived. A stale notice (#2447) is never mailed: its resend answers 202 with the stale notice, unchanged, and leaves its work item, already re-queued when the notice went stale, queued to regenerate the letter. It is refused with 409 once the regeneration produced a live letter (resend that one), when the regeneration failed terminally (that failure was announced as final with notice.stale regenerating = false, and a consumer may already have repaired, so resuming it could mail a second letter; the resend re-queues nothing), when the letter was retracted, or when the notice came from outside the work-item path.

  • GET /v1/notices/queue is the dispatcher’s view: delivery_status = 'pending' with a stored PDF.

POST /v1/documents/render

Request RenderDocumentRequest — { "template_key": "audit-citation", "inputs": { … }, "sign": true }. template_key is allow-listed service-side (never a filesystem path; unknown → 400); inputs is opaque JSON. With sign, the service canonicalizes inputs (JCS) and signs it ES256 (key id canopy-notices-current) under the document typ canopy-document+jws (#2956); the detached JWS is embedded in the PDF and returned as X-Canopy-Signature. Verify it with VerifyingKey::verify_detached_as(…, DOCUMENT_JWS_TYP): a document signature never verifies as a determination. Allow-listed today: audit-citation (the "Cite for hearing" citation, with a GET /v1/security/chain/attest attestation). Response is application/pdf with Cache-Control: no-store.

Error codes

Code Meaning

400

Missing required field; unknown (program, template_key) on generate; unknown template_key on render; resend of a notice with no PDF; an X-Canopy-Actor header (actor_header_retired)

401

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

403

portal_on_non_portal_route (the portal on a route without a portal arm), portal_scope_missing, portal_only_route (a user on mark-read), actor_not_allowed (canopy-cli on a canopy-web read, canopy-web on a canopy-cli route), required_role_missing; ownership_claim_missing / ownership_mismatch on the portal’s list

404

Notice not found (uniform on a foreign household from the portal arm)

409

Resend of a superseded (retracted) notice, or of a stale notice that cannot regenerate (already regenerated, regeneration failed terminally, retracted, or no work item)

422

Unknown program / programs slug on the list

500

Typst compile or storage failure; the notice is not stored

503

No trustworthy key set in time (keys_unavailable)

Template resolution

Templates load from the configuration layers' notices/, each file resolved from the highest layer that holds it (the neutral templates are the fixtures/config/notices-neutral base layer; a manifest only a base layer supplies renders only in development or under CANOPY_NOTICES__ALLOW_DEFAULT_TEMPLATE_FALLBACK, services/canopy-notices/src/notice_tree.rs), through canopy_typst::Manifest (manifest.toml): a (program, template_key) lookup, nothing derived from notice_type. The manifest’s form_number is stamped on the row after the compile; in the neutral templates it is the placeholder FORM-<PROGRAM>-<TEMPLATE-KEY> (reference-ruleset rules). Every [templates.<program>.<key>] entry also declares hearing_rights (required, no default; #2431): true exactly when its file calls the hearing-rights( component, pinned for both shipped rulesets by every_template_entry_declares_the_hearing_rights_its_file_renders (crates/canopy-typst/src/manifest.rs). persist writes the notice’s appeal-rights row only when the resolved template sets it, so a notice has a stored hearing deadline exactly when its letter printed one. The continued-benefits offer prints only inside the hearing-rights box, so the boot refuses a route with continued_benefits_available = true whose template declares hearing_rights = false, naming the event and the template (services/canopy-notices/src/manifest_checks.rs). Date and money helper conventions for template authors live with the rulesets (the pack’s notices/components/money.typ; worker::HOUSEHOLD_DATE_FMT for the Rust side): a present-but-malformed money figure refuses the render rather than printing a guess.

Notice identity

Every letter prints the three letterhead fields: agency_name, agency_address and agency_phone. A letter with a fair-hearing block also prints hearing_phone, appeal_deadline_days ("within N days from the date of this notice") and, when set, hearing_address; a letter without one reads none of the three (pinned by a_template_without_a_hearing_box_reads_no_hearing_field), since only a boxed letter’s appeal-rights row records them for a re-render. All six come from the notice’s resolved identity, configured in the jurisdiction pack, the pack’s jurisdiction.toml:

  • [notices] is the jurisdiction’s identity. Every program without a table of its own uses it. An unknown key anywhere in the block, [notices.acp] and the program tables included, refuses the boot (#2399), so a misspelled [notices.programs.wic] cannot silently leave WIC on [notices]. [notices.acp] states one form (#3439): a fixed table (the default) needs line_1, city, state and zip; a per_participant table states none of them; anything else refuses the boot.

  • [notices.program.<program>] (for example [notices.program.wic]) is one program’s complete identity, used in place of [notices] on that program’s letters. It has the same six fields and the same requiredness: hearing_address is optional and every other field is required. A table without hearing_address prints no hearing address; it never borrows the jurisdiction’s. A table missing a required field, carrying an unknown key or naming a slug that is not a program refuses the boot. Nothing is inherited, so one letter never mixes two agencies.

NoticeConfig::identity(Option<Program>) (services/canopy-notices/src/config.rs) is the one resolver for a new notice. Generation renders from it, and persist stores from the same resolution: for a letter with a hearing box, the appeal-rights row’s hearing_phone, hearing_address and hearing_request_deadline (notice_date + appeal_deadline_days), and the notice row’s letterhead columns (agency_name, agency_address, agency_phone). The printed and the stored deadline therefore agree. The #1639 side-channel text prints its program’s agency_phone the same way.

A template’s program_data cannot override any of the six fields or notice_date: canopy_typst::context::flatten_context keeps the configured value and logs the collision at WARN. Every other key, effective_date included, is still overridden by program_data.

Federal floor. The federal layer’s hearing-request-windows.json lists a minimum window per program, with its authority (WIC: 60 days, 7 CFR 246.9(e)). At boot canopy-notices resolves each listed program’s identity, from its table or from [notices], and refuses to start when the window is below the floor, naming the program, the window, the floor and the authority. Every window, [notices]' and each program table’s, is also refused at boot outside 1..=366 days, naming its table and key (#2924). A program the file does not list has only that bound; giving another program a floor is a data edit.

Re-rendering reproduces what was stored. The on-demand re-render behind GET /v1/notices/{id}/pdf never reads a [notices.program.<program>] table. A notice with a stored letterhead and appeal-rights row re-renders with them; the current [notices] fills only what the rows do not record:

  • the letterhead comes from the notice row’s columns. NULL means persist recorded none: a row persisted before the columns existed, which printed [notices], or one loaded outside the generator (the seed tool). Both re-render with the current [notices] letterhead;

  • the hearing phone and address come from the notice’s appeal-rights row, and the window is its hearing_request_deadline minus notice_date; a notice with no appeal-rights row (a seed-loaded notice, or a letter without a hearing box, which prints none of these fields) gets the [notices] hearing fields;

  • the continued-benefits offer (#2398) is the appeal-rights row’s continued_benefits_available with the notice row’s cb_election_deadline, the date the letter printed. Without a rights row the offer stands exactly when the notice row carries a deadline, and the rights row’s continued_benefits_request_deadline (NULL on every row persist writes) is read only when the notice row has none;

  • the program data (#2454) is the notice’s notice_program_data snapshot: the program_data its letter rendered, which persist writes with the notice. The snapshot omits the keys that name a person (NAMES_A_PERSON in services/canopy-notices/src/program_data_snapshot.rs), so a re-render prints no Regarding: line, names no representative (#3057) and no sanctioned member, and prints the placeholder where a SNAP claim letter names its liable adults. Each snapshot key is written over the placeholder set, so a template key added after the notice was issued prints its placeholder. A re-render without a snapshot (a seed-loaded notice, or one persisted before the table existed) prints the em-dash placeholders and logs re-render without a program_data snapshot: placeholders at INFO.

A notice persist wrote therefore re-renders with the identity and program data it was issued under after the configuration changes.

The re-render compiles the template version the notice records (template_version), never the current one under the old notice's name (#3058). The pack keeps only each template's current version, so a notice issued at an earlier version is refused with 409 notice_template_version_unavailable, naming both versions, rather than reprinted from a template that differs from the letter mailed. Seeded notices record the version of the manifest canopy-notices renders their jurisdiction with: the pack's own, or default's when the pack ships none.

Event routing ([[event_routing]])

The subscriber on queue canopy-notices.events binds every event_type in the manifest and routes by payload discriminators. Precedence when several entries share an event_type: (created_source, reason_code) → created_source → action_type → applied_via → interview_mode → recipient_kind → (status, effective_date_basis_kind) → (status, served_program) → status → the discriminator-less entry; a discriminated entry never catches a non-matching payload, and the status and bare tiers exclude family-discriminated entries. An entry with suppress = true + reason silences the whole event in its tier (the letter is another service’s). Adding a value is a manifest entry; adding a discriminator is a Rust change. served_program (#2943) is matched against the payload’s program, since the manifest’s program is the letter’s own program; an entry naming it must name a status, refused at load otherwise. A letter’s program must be a canonical lowercase canopy_reference::Program slug (snap, wic, …); loading refuses any other value, naming the route (#2438). The Georgia table (the georgia pack’s notices/manifest.toml; the default ruleset mirrors it):

Event Discriminator → template_key (notice_type) Program

determination.completed.snap

status=approved → noa-approval (notice_of_action); status=approved ∧ effective_date_basis_kind=expedited_postponed → expedited-postponed-approval; status=denied → noa-denial; effective_date_basis_kind=in_cert_conversion (approved or denied) → suppressed (the enrollment pipeline’s letter is the household notice)

snap

tanf.determined

status=approved → noa-approval; status=denied → noa-denial. An approval with benefit_issued = false (the computed benefit under the minimum issuance, #2927) prints "None issued" and says the household is eligible, that no payment is issued, and why, stating computed_benefit and minimum_benefit; it refuses to render without either figure

tanf

medicaid.determined

status=approved ∧ served_program=medicaid → noa-approval (coverage body); status=denied ∧ served_program=medicaid → noa-denial (one reason line per reason); status=approved ∧ served_program=chip → the CHIP noa-approval (coverage body naming the jurisdiction’s CHIP program); status=denied ∧ served_program=chip → the CHIP noa-denial (one reason line per reason; 42 CFR 457.340(e)); an outcome naming no routed program letters nothing (#2943, a notice per decision). The letters print the words the event carries and look no class or reason up (#3422): the approval routes forward assigned_coa_label beside assigned_coa, and an approval that names a class with no label is refused, not lettered with a placeholder; a denial prints each pair's coa_label and reason_text, or the event's denial_reason_texts, and drops a pair that lacks either word (an event published before the words were carried); when no reason survives, or the route forwarded no reason key at all (denial_reasons_by_coa, denial_reason_texts or the administrative reason), the denial is refused, not lettered with an empty reason box (42 CFR 431.210(b)); both denied routes list the first two keys under program_data_keys (#3442), while a notice already issued re-renders from the lines stored with it

medicaid, chip

application.denied.{snap,tanf,medicaid,chip,caps,wic}

→ noa-denial (notice_of_action); the SNAP route forwards the reopen and reinstatement keys, the five shared-body routes forward reason only

per key

abawd.warning_month_1, abawd.warning_month_2, abawd.time_limit_reached

→ abawd-warning (abawd_notice): forwards months_used (1 or 2 on a warning, whose used and remaining countable months the letter states; the time limit on abawd.time_limit_reached, for which it states the limit reached and that a separate notice comes before benefits end, #3221), and the pack’s [snap.abawd] figures canopy-snap puts on the event (abawd_qualifying_hours, abawd_age_min, abawd_age_max, abawd_dependent_child_age), which the work requirement and the exemption list print (#2437; a re-render without a snapshot prints each line without its figure); no hearing box (#2434)

snap

enrollment.expungement_pending

→ expungement (expungement_notice, notice_required = true)

snap

appeal.filed

→ appeal-acknowledgment (appeal_acknowledgment)

snap

appeal.continued_benefits_granted

→ continued-benefits (continued_benefits_notice)

snap

ipv.disqualification_imposed

→ sanction (sanction_notice)

snap

renewal.material_change

→ change-in-circumstances (change_in_circumstances)

snap

snap.overpayment_claimed, tanf.overpayment_claimed, medicaid.overpayment_claimed

→ overpayment (overpayment_notice). The SNAP letter is the claim's initial demand letter ([snap-claim-letter]).

per key

enrollment.adverse_action_scheduled

created_source=periodic_report ∧ reason_code=periodic_report_verification_failure → pr-vcl-termination; created_source=periodic_report → pr-combined (periodic_report_termination); created_source=continuation ∧ reason_code=mass_change_benefit_reduced → mass-change-reduction (mass_change_reduction); created_source=continuation ∧ reason_code=mass_change_ineligible → mass-change-termination (mass_change_termination) — the 7 CFR 273.12(e)(1)(ii) mass-change notices of the COLA (#806; the change_* / continuation_* reasons have no pair entry and fall through); action_type=reduction → noa-reduction (adverse_action_reduction); otherwise → noa-termination (adverse_action_termination)

snap

enrollment.continuation_applied

applied_via=immediate → benefit-continuation (notice_required = true); adverse_action_enacted matches nothing

snap

renewal.snap_expiration_notice_due

→ notice-of-expiration (notice_of_expiration)

snap

wic.expiration_notice_due

→ notice-of-expiration (wic_notice_of_expiration, notice_required = true, addressing = "caretaker_for_minor"): the 7 CFR 246.7(j)(8) advance notice; forwards certification_end; no hearing box, so no appeal-rights row (#2390). It prints the WIC nondiscrimination statement (components/wic-nondiscrimination.typ), never SNAP’s civil-rights.typ: the pinned USDA text word for word, which a render test compares against the ruleset’s components/wic-nondiscrimination.txt (#2449)

wic

wic.termination_scheduled

→ notice-of-termination (wic_notice_of_termination, effective_date_policy = "verbatim", notice_required = true, addressing = "caretaker_for_minor"): the 7 CFR 246.7(j)(6) notice of a mid-certification termination (246.7(h)(1)(ii)); forwards effective_date (the termination date, the first day not certified), reason_code and, on a replacement letter, replaces_effective_date. The template holds one reason sentence per code and refuses the render on an unknown one. The letter prints the hearing box on the WIC identity’s window, the last day to request a hearing (the stored notice_appeal_rights deadline) as the date after which the decision prevails, no continued-benefits offer (the payload carries no cb_available), the #2449 WIC statement and, on a replacement, a line quoting the earlier letter’s own words: "This notice replaces our earlier notice that said you would be terminated from <the program, as the letter names it> on <replaces_effective_date>", the termination date the earlier letter printed. Georgia’s letter adapts the DPH Notice of Termination form (Revised February 2023) without its voucher line, signature, date-of-birth and phone fields or Spanish pages (#2391)

wic

wic.termination_rescinded

→ termination-rescinded (wic_termination_rescinded, notice_required = true, addressing = "caretaker_for_minor"): the letter that corrects a WIC notice of termination that went out when its termination is cancelled before it takes effect (#2451); forwards rescinded_effective_date (the date that notice printed), cancel_reason and certification_end. The template words the certification by the reason (a worker, expires_first or appeal_reversed cancel: it continues to its end date; expired: it ran to its end date; superseded: a new certification replaced it) and refuses the render on an unknown reason or a non-ISO date. Informational: no hearing box, so no appeal-rights row; it prints the WIC nondiscrimination statement (components/wic-nondiscrimination.typ)

wic

renewal.snap_certification_converted

→ senior-conversion (senior_conversion)

snap

renewal.snap_periodic_report_due

→ pr-due (periodic_report_due)

snap

renewal.snap_periodic_report_vcl

→ pr-vcl (periodic_report_vcl)

snap

verification.requested

→ verification-checklist

snap

application.interview_scheduled

interview_mode=telephone / face_to_face / home_visit → interview-appointment; on_demand → interview-on-demand plus delivery_channel=sms → interview-on-demand-text (two work items from one event)

snap

application.interview_missed

→ nomi

snap

application.pending_agency_delay

→ agency-pending

snap

application.snap_episode_voided

→ reopen-supersession-void

snap

application.rep_disqualification_noticed

recipient_kind=household_member → rep-disqualification-household; authorized_representative → rep-disqualification-rep

snap

application.rep_disqualification_rescinded

recipient_kind=household_member → rep-disqualification-rescinded-household; authorized_representative → rep-disqualification-rescinded-rep

snap

Each entry’s program_data_keys names the payload keys forwarded to the template (ADR-004: ids, tokens, dates and decimal strings — never names or addresses); the manifest is the authority for the per-letter key list. Producer contract for every route: top-level household_id + person_id (the recipient — the head of household, or the representative on authorized_representative routes); an event missing either is acked and skipped (a WARN when the route is kind-bearing or notice_required).

Addressing (addressing, a letter field, never a discriminator). subject, the default, addresses the event’s person. For a subject below [notices] age_of_majority on the legal day, responsible_adult_for_minor (the Medicaid and CHIP NOAs, #1941, #2943) addresses the adult who applied, else an active individual authorized representative scoped to the notice’s program (CHIP under medicaid), and caretaker_for_minor (the WIC notices of expiration and of termination, #2390, #2391) addresses the application’s filer when they are a member of the subject’s household at any age, 7 CFR 246.7(j)(8)'s participant, parent or caretaker, else that representative. A redirected letter names the subject on its Regarding: line and records it in subject_person_id; a minor who applied for herself receives her own letter with no such line. No addressee is a retryable work-item error, never a letter to the child.

Nondiscrimination statement (#2449, #2463, #2464, #2465, #3010). Each letter prints its program’s statement, which components/nondiscrimination.typ selects for the engine’s template_program input, the program whose manifest entry the letter resolved under; the choice is the pack’s. Every shared template (shared/noa-{approval,approval-coverage,denial,termination}.typ, shared/sanction.typ, shared/overpayment.typ) prints the selected statement. Each statement is a component that prints its pinned text word for word at body size. USDA’s WIC statement prints as one unbreakable block; SNAP’s breaks only between its paragraphs, its complaint paragraph kept with its closing line (#3010). The longer HHS statements flow across a page break, so they leave no near-empty page before them; each keeps its opening paragraph, any heading with its first paragraph, and the Section 1557 notice’s closing notice of availability on one page. A .txt sidecar beside each component holds that text, and a render test compares the program’s letters against it.

  • SNAP letters print components/civil-rights.typ, USDA’s current SNAP and FDPIR statement (the FNA "Nondiscrimination Statements" page, compliance/policy-sources/dph-wic-manifest.toml docs."usda-fna-nds-snap").

  • WIC letters print components/wic-nondiscrimination.typ, USDA’s statement for programs other than SNAP (docs."usda-fna-nds", same manifest).

  • TANF and CAPS letters print components/hhs-nondiscrimination.typ, an HHS-program statement with no USDA text (45 CFR 260.35; 45 CFR 98.13(b)(5)). georgia’s quotes the HHS parts of DFCS’s joint statement: the HHS sentence, the HHS OCR complaint block, and the DFCS Civil Rights, ADA/Section 504 Coordinator and DHS LEP contacts. CAPS uses it as a best-effort choice, since no CAPS parent-facing statement exists.

  • Medicaid and CHIP letters print components/section-1557-nondiscrimination.typ: a notice of nondiscrimination with the eight elements of 45 CFR 92.10(a)(1), followed by the English notice of availability of 45 CFR 92.11(a). Its wording follows HHS OCR’s 2024 sample notices. georgia’s carries DCH’s Civil Rights Coordinator, language line and website. The 92.11(b) translations into the State’s 15 most common LEP languages are not printed yet (#2464).

The default pack’s TANF, CAPS, Medicaid and CHIP statements are federal text with bracketed placeholders for the agency’s contacts. The sources, retrieval dates, and what each pinned text quotes and authors are in compliance/policy-sources/civil-rights-manifest.toml.

From event to letter

The subscriber does not render in the inbox transaction. It persists a notice_work_items row (atomic with the inbox row, idempotent on (source_event_id, notice_type)) and acks. A worker loop claims items under FOR UPDATE SKIP LOCKED, resolves the recipient from canopy-persons (legal name, membership check, mailing-first address; the household’s confidentiality election is read from canopy-applications fail-closed so an address_confidential household routes through the [notices.acp] substitute), renders outside any transaction, and commits the notice + appeal rights + notice.generated in one claim-fenced transaction. Failures retry with exponential backoff to a terminal failed + last_error after 8 attempts. A dispatcher loop drains pending notices through the delivery adapter, stamps dispatched_at and publishes notice.dispatched. delivery_status: pending → dispatched (terminal today — sent / delivered_at await a receipt-capable carrier), failed, superseded, stale; a resend returns the row to pending.

The legal day (#2447). A notice is dated with the legal day it is rendered on, and its deadlines count from that date, while the law counts them from mailing, which is the provider hand-off (#1091). So before each hand-off the dispatcher compares a never-dispatched notice’s notice_date with today’s legal date in [jurisdiction].timezone, read from the service’s one injected decision clock (the same handle dates the notice and stamps dispatched_at). A notice whose day has passed is never delivered: it goes stale, leaves every read (active = false, its appeal-rights row with it), stages notice.stale, and its work item is re-queued in the same transaction, so the worker renders a fresh letter dated today with recomputed deadlines under the same source event, whose notice.dispatched is the only dispatch evidence producers see. A stale notice whose letter was retracted meanwhile goes superseded and is not regenerated; one outside the work-item path cannot be regenerated: it is logged at ERROR and counted by the gauge canopy_notices_stale_unregenerated{notice_type} (#2460; configuration reference). A resent copy of a letter already dispatched keeps its date. A day can still cross after that check, above all during the provider call itself: the stamp then records the true, later dispatched_at, so a consumer gating on dispatched_date = notice_date sees the difference, and the dispatcher logs WARN.

Two dedicated subscribers sit beside the manifest table: queue canopy-notices.recovery handles application.applicant.recovery_initiated (an email/SMS kill-switch notice to the application-time contact, read back from GET /v1/applicants/recover/{recovery_id}; ADR-026; a logging stub adapter for UAT), and queue canopy-notices.noe-superseded retracts a stale letter (src/retractions.rs; the module was noe_superseded.rs until #2391, and the queue keeps its first name because renaming a live durable queue is a broker migration). It binds three keys, each mapped to the notice_type its due route stages the letter under: renewal.snap_expiration_notice_superseded → notice_of_expiration, wic.expiration_notice_superseded → wic_notice_of_expiration (#2390) and wic.termination_notice_superseded → wic_notice_of_termination (#2391); a delivery under any other key parks (#1131). Its log lines name the notice_type. Every retraction is recorded as a notice_retractions row (#2446). It flips a still-queued work item of that type to superseded, or its undispatched notice when no dispatcher holds the notice under a live lease; every path that supersedes a notice also retires it from reads (#2456). A pending notice already mailed once (dispatched_at set) is a resent copy: a retraction cancels only the copy, and the notice stays dispatched, readable, with its first dispatched_at. A leased notice may already be with the provider, and no lock is held across that call, so it is left to its dispatcher. The dispatch claim never takes a retracted notice. Immediately before each hand-off the dispatcher takes a last look: it renews the notice’s lease only while that lease is still live, supersedes the notice instead if its retraction committed since the claim, and never hands over a notice whose lease expired. A letter retracted after that look is mailed and stamped, and its notice.dispatched tells the producer it went out. A refused delivery of a retracted notice supersedes it, and each dispatch pass supersedes one whose lease expired unstamped. A retraction whose letter is not staged yet (it overtook its due event on the other queue) makes the subscriber refuse to stage that event (#2432). The consumer and the staging both take a transaction-scoped advisory lock on the source event id first, so a retraction racing an uncommitted staging waits for it and retracts the staged item.

Events published

  • notice.generated — staged in the worker’s persist transaction; since #2459 it carries the work-item key source_event_id + notice_type, as notice.dispatched does (null source_event_id outside the work-item path), so a consumer can recognise a regenerated letter as the stale one’s replacement.

  • notice.stale (#2459; payload canopy_contracts_notices::events::NoticeStaleV1) — staged in the transaction that retires a notice whose legal day passed before dispatch (#2447): the notice, household, notice type, the work item’s source_event_id (null outside the work-item path), the adverse_action_id, the printed notice_date and noticed effective date, regenerating (whether a letter regenerated under the same source_event_id follows) and retired_at. When the work item regenerating it goes terminally failed, the worker announces the same notice again with regenerating = false, in the failure’s transaction. canopy-enrollment keeps the letter’s adverse-action version as a staged successor while it is regenerating, and supersedes it when the regenerated letter is recorded or when no regeneration will come. A retracted stale notice goes superseded and stages none.

  • notice.dispatched — staged with the dispatch stamp; dispatched_at / dispatched_date are always the FIRST dispatch, so a resent copy republishes them unchanged and names its own hand-off as resent_at (null on a first dispatch, #2458); carries source_event_id + notice_type (the correlation dispatch-gated consumers key on: canopy-verification’s due-date re-anchor, canopy-applications' NOMI and postponement stamps, canopy-renewals' NOE stamp) and application_id, determination_id, program (null when the row has none).

    Pinned notice types (#2435). A letter some code recognises by its notice_type is pinned in canopy_contracts_notices::correlation with the route that stages it (event type and discriminators), in two sets. CORRELATED_NOTICES are the letters another service keys on: nomi (application.interview_missed), rep-disqualification-rep (application.rep_disqualification_noticed, recipient_kind=authorized_representative) and expedited-postponed-approval (determination.completed.snap, status=approved ∧ effective_date_basis_kind=expedited_postponed), whose dispatch canopy-applications stamps; verification-checklist (verification.requested), whose dispatch re-anchors canopy-verification’s due dates; notice_of_expiration (renewal.snap_expiration_notice_due), stamped by canopy-renewals; wic_notice_of_expiration (wic.expiration_notice_due), whose dispatch canopy-wic’s dispatch consumer stamps (#2390); and wic_notice_of_termination (wic.termination_scheduled), pinned for canopy-wic’s dispatch consumer, which stamps it once canopy-wic schedules terminations (#2391). The retraction consumer here retracts both notices of expiration and the WIC notice of termination. ENRICHED_NOTICES are the letters this service’s own worker enriches before render: expungement_notice (enrollment.expungement_pending), built from the event’s issuance facts, and the appointment letters rendered from the interview row: interview-appointment (application.interview_scheduled, one route each for interview_mode=telephone, face_to_face and home_visit), interview-on-demand and its text interview-on-demand-text (both interview_mode=on_demand) and nomi; and overpayment_notice (snap.overpayment_claimed), the SNAP claim letter ([snap-claim-letter]). Every consumer in this tree reads the constants. canopy-notices refuses to boot when the loaded manifest’s route for a pinned letter stages letters none of which carries its type, naming the event, the discriminators and both types; a manifest that does not route the letter, or only suppresses it, loads.

The SNAP claim letter (#2228). snap.overpayment_claimed stages the claim's initial demand letter, which 7 CFR 273.18(e)(3)(iv) requires to state sixteen things, (A) to (P). The route forwards claim_id, overpayment_amount, claim_basis, period_first_month, period_last_month and months. Before the render the worker and the generator add:

  • claim_period_first and claim_period_last, the period's months as the letter prints them (March 2026), and a printable month on each months row. A letter whose event states no whole-month period is not rendered: the item goes onto its retry ladder naming the missing key.

  • liable_adults, the display names of the adults the claim is collected from (273.18(a)(4)(i)). The worker reads the household's roster from canopy-persons (GET /v1/households/{id}/full with an empty projection, so no SSN is opened) on the period's first day and on its last. A member is named when at or past [notices].age_of_majority on the day of a roster they appear in. A member present only between those two days is not seen; recording liability on the claim itself is left to the claims ledger (#930). No adult on either day, or an unreadable roster, is an error and no letter is sent.

  • claim_due_date, the letter's date plus the pack's [notices.claims].repayment_due_days.

liable_adults is one of NAMES_A_PERSON, so the names are printed in the stored PDF and never written to notice_program_data; the due date and the period are. The template words the claim's type and reason from claim_basis, prints the calculation table or, for a claim with no itemized months, a sentence saying so, and prints the allotment-reduction block O), (P only when an allotment_reduction input is present, which nothing sets until #930. The neutral letter appends a repayment agreement for agency-error and household-error claims and omits it for an intentional program violation.

Design history: the archived notice-generation plan, the adverse-action pipeline plan (the periodic-report and termination letters), and snap-intake-completion (the interview, NOMI, checklist, agency-pending, void, continuation and representative letters).

Edit this page · default