canopy-eligibility API Reference

For a service integrator (the BFF, canopy-renewals, canopy-medicaid’s CMD) and an operator running a bulk cohort: canopy-eligibility dispatches a determination request to the program services in parallel, verifies the JWS on each returned determination (ADR-002), assembles the combined result, and owns the bulk-run and order ledgers. Tables: the data-models page; design history: eligibility-orchestrator, the COLA bulk program, the async-bulk audit.

Base URL

container port 8004 (host: CANOPY_PORT_CANOPY_ELIGIBILITY_8004 in .ports.env)

Authentication

Bearer token: a canopy-identity token for this receiver (its aud is urn:canopy:service:canopy-eligibility), 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-applications, canopy-renewals, the portal and canopy-eligibility itself hold a system edge to canopy-eligibility; canopy-web, canopy-cli, canopy-applications and canopy-renewals hold delegation edges. The determine write admits a system caller or the writer bar (its bulk and order markers canopy-eligibility’s own system token alone), the reads a system caller or caseworker+ (also canopy-web’s worker readers on case status and the household determinations, and the portal holding portal:determinations:read on the latter), and the bulk-run reads a system caller or supervisor or admin; the two alerts feeds, the bulk-run mutations, the quarantine routes and the held-determination routes are user-only. A refusal is 403 with its ReceiverDenial code (ADR-049 Amendment 14); each route’s constant is in the authorization inventory.

Database

canopy_eligibility

Admission specifics

  • The determine markers. POST /v1/eligibility/determine admits WRITER; a request carrying the bulk or order marker must also pass SELF_CALL (Admission::system_from(&[ConfidentialClient::Eligibility]), api/handlers.rs), the consumers' self-calls: another system caller is 403 service_not_allowlisted, a user 403 system_caller_required. Both markers at once are 400 order_and_bulk_markers; a bulk dispatch without a numeric x-canopy-bulk-generation header is 400 bulk_generation_header_missing.

  • Portal ownership. GET /v1/eligibility/determinations checks the portal’s applicant claim against the queried household (principal.require_owned_household): 403 ownership_claim_missing without one, ownership_mismatch for another household.

  • Outbound. A request’s calls ride its outbound (RequestOutbound): a worker’s determine carries the worker’s delegation onward to every program it dispatches, and to persons, applications, enrollment, renewals and verification; a system caller’s carries canopy-eligibility’s system tokens. The run config holds both the outbound and canopy-eligibility’s sender (DetermineConfig { source, system }, orchestrator.rs); the sender makes the replayed operation’s envelope read (Signature verification), which stays system inside a request. The bulk-run admin routes' corpus, parameter-provenance and universe reads are system too, through the sender in UpstreamDeps (api/bulk_runs_upstream.rs). The bulk and order consumers self-call, and make their own reads, through the sender.

  • Attribution. The bulk-run ledger (created_by, canceled_by, each action row’s actor), the quarantine and held resolutions' actor and the alerts access event’s actor record principal.attribution_sub(): the caller’s canopy subject on the user-only routes. DetermineRequest.requested_by stays caller-supplied.

Routes

Mounted by routes() in services/canopy-eligibility/src/api/mod.rs; spelling from crates/canopy-contracts-eligibility/src/paths.rs (the three request/result reads are registered as literals with no constant).

Route Access Success Refusals (RFC 9457 code)

POST /v1/eligibility/determine

system; writer (a bulk or order marker: system: canopy-eligibility)

200 DetermineResponse

400 no members / household absent as-of; 404 application context absent; 409 postponement_rows_pending, determination_operation_open, idempotency-key reuse; 422 conflicting_episodes, certification_conversion_pending, change_reported_on_required, order_anchor_behind_processing_month, order_outside_certification, unknown application_id / household_id (ADR-025, uncoded); 502 determination_context_unavailable, owning service unreachable during the ADR-025 probe (uncoded), breaker open; 503 enrollment_state_unavailable, operation_probe_failed

POST /v1/eligibility/determine/dry-run

system; caseworker+

200 DryRunResult

400 no members / household absent; 404 unknown baseline; 422 cross-household, snapshot-less or incomplete baseline, unknown corpus or params_digest

GET /v1/eligibility/requests/{id}

system; caseworker+

200 EligibilityRequest

404

GET /v1/eligibility/requests/{id}/determinations

system; caseworker+

200 [ProgramDetermination]

—

GET /v1/eligibility/results/{application_id}

system; caseworker+

200 CombinedResult

404

GET /v1/eligibility/cross-program-alerts/scoped?subject=&limit=

caseworker+ (caseworker tier: own subject, subject optional; supervisor / admin: subject required)

200 [CrossProgramAlert]

400 subject_required (supervisor / admin sent none); 400 invalid subject (empty, over 255 bytes, non-ASCII, control character, or repeated) or unknown query key; 403 another subject (caseworker tier, uncoded); 422 unknown programs; 502 applications_unreachable, assignment_set_too_large

GET /v1/eligibility/cross-program-alerts/all

supervisor or admin; supervisor, admin or studio_admin via canopy-web

200 [CrossProgramAlert]

400 unknown query key (a subject included); 403; 422 unknown programs

GET /v1/eligibility/case-status

system; caseworker+; worker reader via canopy-web

200 CaseStatus

404 no determination yet

GET /v1/eligibility/determinations?household_id={hid}&limit={n}&offset={m}

system; portal (portal:determinations:read); caseworker+; worker reader via canopy-web

200 [ProgramDetermination], newest first (determined_at DESC, id DESC); limit default 50, max 200; offset default 0 (out-of-range values clamped, never refused)

403 ownership_claim_missing / ownership_mismatch (portal)

GET /v1/eligibility/determinations?household_id={hid}&latest_per_program=true

system; portal (portal:determinations:read); caseworker+; worker reader via canopy-web

200 [ProgramDetermination], at most one row per program (that program’s newest), newest first; unpaged — limit/offset ignored

403 ownership_claim_missing / ownership_mismatch (portal)

POST /v1/eligibility/bulk-runs

admin

202 + Location

400 idempotency_key_not_allowed; 409 active run / dedup; 422 invalid_reason, cohort bounds

GET /v1/eligibility/bulk-runs, …/{id}, …/{id}/failures, …/{id}/actions

system; supervisor or admin

200

404

POST /v1/eligibility/bulk-runs/{id}/enact

admin

202

409 gate ladder (below); 422

POST …/{id}/pause, POST …/{id}/resume

supervisor or admin

200

409 state

POST …/{id}/cancel, POST …/{id}/retry-failures

admin

200 / 202

409 state

GET /v1/eligibility/quarantined-determinations?programs=&household_id=&after_received_at=&after_id=&limit=

determination operator

200 QuarantinedDeterminationsPage; household_id narrows to one household (#2321)

403; 422 unknown_program, partial_cursor, invalid_limit

GET /v1/eligibility/households/{household_id}/quarantined-determinations/count

case reader via canopy-web (delegated::ELIGIBILITY_GET_ELIGIBILITY_HOUSEHOLDS_HOUSEHOLD_ID_QUARANTINED_DETERMINATIONS_COUNT)

200 QuarantineCount (open): the household’s open interactive envelopes in the delegation’s own programs, a count alone, never an envelope (#2321)

403

GET /v1/eligibility/quarantined-determinations/{id}

determination operator

200 QuarantinedDeterminationView

403; 404

POST /v1/eligibility/quarantined-determinations/{id}/resolutions

determination operator

201 ResolveQuarantineResponse; 200 on a repeated reverify

403; 404; 409 (Quarantined envelopes); 422 invalid_note

GET /v1/eligibility/held-determinations?program=&after=&limit=

determination operator

200 OperatorHeldDeterminationPage

400 unknown program or malformed query; 403; 422 invalid_limit, invalid_cursor; 502 program_unavailable

POST /v1/eligibility/held-determinations/{determination_id}/drops

determination operator

201 HeldResolution

403; 409 not_held, recorded, quarantine_open, already_resolved, determination_in_flight (Held determination events); 422 invalid_note; 502 program_unavailable

POST /v1/eligibility/determination-operations/{operation_id}/adoptions

determination operator

201 HeldResolutions

403; 404; 409 (Adoption); 422 invalid_note; 502 program_unavailable

Access legend (arms joined by "; ", bars in crates/canopy-auth/src/roles.rs): system = any system caller but the portal; system: canopy-eligibility = only canopy-eligibility’s system token; portal (scope) = the portal holding that scope; writer = CASEWORKER_WRITER_ROLES (quality_control is read-only); caseworker+ = CASEWORKER_OR_ABOVE_ROLES; worker reader = WORKER_READER_ROLES; determination operator = DETERMINATION_OPERATOR_ROLES (eligibility_specialist, supervisor, admin); a role set in backticks admits those roles; a bar alone is a user’s delegation through any client, and via canopy-web only through canopy-web. A route with no system arm refuses a system caller 403 service_class_on_user_only. paths::REDACT_DETERMINATION is a program-service path this router does not mount.

POST /v1/eligibility/determine

An admitted interactive or order determine runs on its own task (canopy_api::run_to_completion, #3202): a caller that disconnects, as canopy-web does when its determine_timeout_ms expires, does not cancel it. The run finishes, records, and canopy-applications projects the outcome from its verdict. Run inline, a cancelled determine left its in_progress request row holding the pending slot, so a re-run was refused 409 until the stale TTL.

Request DetermineRequest — { "application_id", "household_id", "programs": ["snap"], "requested_by", "change_reported_on"? }; the bulk and order self-calls add bulk / order and are exact-canopy-eligibility-identity only. change_reported_on (DetermineRequest.change_reported_on, crates/canopy-contracts-eligibility/src/determine.rs) is the household’s report date for an interactive re-determination of an enrolled household (7 CFR 273.12(c)): required when the derivation selects interim_change (422 change_reported_on_required otherwise), ignored otherwise, never set on the bulk or order self-calls; off the wire when absent. Response DetermineResponse:

{
  "request_id": "uuid", "application_id": "uuid",
  "programs_approved": [ { "program": "snap", "status": "approved", "benefit_amount": "535.00",
                           "basis": null, "determination_id": "uuid" } ],
  "programs_denied": [], "programs_pending": [],
  "total_monthly_benefit": "535.00", "assembled_at": "2026-05-28T12:00:00Z"
}

Each entry is a ProgramResult (program, status, optional benefit_amount, basis, determination_id, snapshot_hash, denial_reason_codes, advisories). snapshot_hash is the SHA-256 of the input snapshot the program service signed, present for a determination of record (ADR-028). advisories relays the signed envelope's operator advisories from the determination of record (ADR-002 Amendment 9, #3324), and is absent when there are none and on every synthesized result. status is a ProgramOutcome (#628): a program’s signed verdict — approved, denied, sanctioned or withheld (canopy_reference::DeterminationStatus; a withheld result lands in programs_denied, the bucket of verdicts that authorize nothing) — or one of the two outcomes that have no determination behind them, pending_verification and input_unsatisfiable. determination_id is present on a determination of record and absent on a synthesized pending, which instead carries a typed failure (unconfigured | breaker_open | transient_upstream | upstream_conflict | terminal_rejection | contract_violation | signature_quarantined | persist_failed | envelope_conflict, the upstream status, a bounded excerpt, and upstream_code — the refused program body’s RFC 9457 code). A program response whose status is outside the verdict vocabulary fails typed parsing and pends as contract_violation; so does a program’s 409 idempotency_body_mismatch (its idempotency layer holds the dispatch key under another body, #2652; upstream_code keeps the token), never upstream_conflict. On an order run, canopy-snap’s and canopy-medicaid’s mismatch is first read back through the epoch’s operation (#2676; canopy-snap’s GET /v1/determination-operations/{operation_id}/envelope, canopy-medicaid’s …/envelopes, every subject’s, #2673). Determinations found there are adopted, as on a replay. The coded 404 operation_not_determined pends contract_violation with upstream_code operation_not_determined. Any other answer to the read pends transient_upstream, keeping the mismatch token. sanctioned files into programs_denied. The signature and binding outcomes are in Signature verification. The combined result, the request’s completed flip and the determination.completed outbox row commit in one transaction; a terminal order failure commits atomically with determination.order_failed.

State of residence (Medicaid and CHIP, #3094). The household read (fetch_household_context) also projects each member’s addresses group, and MemberContext.state_of_residence carries the state of the member’s residential address in force on the evaluation date (residential_state). A member with no residential address of their own takes the applicant’s, the member head_of_household_person_id names (inherit_applicant_residence; maintainer ruling 2026-10-29), and a member’s own address always wins. Only an address_type of residential counts: a mailing address never stands in for one, although primary_address falls back to it. canopy-medicaid determines every member (42 CFR 435.403; 42 CFR 457.320(a)(1)), so before a Medicaid or CHIP dispatch the mapper requires each member’s state to be a USPS code that canopy_reference::fips::State::from_abbreviation resolves (mappers::require_member_states). A member left without one (neither their own nor the applicant’s), a code that names no state, or an empty roster pends the program input_unsatisfiable with missing_inputs [{"field": "members[].state_of_residence", "source_class": "persons"}]. Nothing is dispatched or persisted; the worker records the residential address and re-runs. Whether that state is the jurisdiction’s own is canopy-medicaid’s finding, not the mapper’s. SNAP and TANF receive the field and never pend on it.

Pregnancy and homelessness (#3145). The household read also projects each member’s pregnancies and the household’s homelessness groups (canopy-persons), and three fields carry them as of the evaluation date:

  • MemberContext.pregnancy is the MemberPregnancy (expected_delivery_date, fetus_count, family_size_increase_waived; crates/canopy-types/src/household.rs) of the accepted pregnancy window that covers the day, valid_from ⇐ as_of < valid_to (pregnancy_on), else null.

  • MemberContext.pregnancy_end_date is the latest end on or before the day among the member’s pregnancy facts, else null. A fact’s end is the valid_to of its last window, grouped by fact_id: a correction splits a fact into windows, and an earlier window’s end is not an end (latest_pregnancy_end).

  • ApplicationContext.homeless (required) is true when an accepted homelessness period covers the day and false otherwise (homeless_on): a household never recorded homeless is not.

A crypto-shredded pregnancy fact feeds neither member field (ADR-036), as a shredded income fact feeds no budget. The fields ride every body that carries the generic context. canopy-snap reads pregnancy for the ABAWD exception (canopy-snap); TANF and Medicaid ignore them. WIC's own body carries them per participant (below); the two pregnancy dates and the homeless status are persons-sourced rows of compliance/input-requirements/wic.toml.

Standard categorical eligibility facts (SNAP, #3322). For a request naming snap, each member carries two facts, set before the context is cloned per program (member_facts.rs); canopy-snap reads them for 7 CFR 273.2(j)(2)(i) standard categorical eligibility. Both are omitted from the wire when unknown, and a failed read never refuses the run. The bulk COLA arm and the dry-run read neither (#3325). They name their baseline as member_facts_from, and canopy-snap carries the facts frozen in its snapshot (canopy-snap), so a mass change or a what-if makes no TANF read and no SSA lookup.

  • MemberContext.receives_tanf_cash: true for a member included in the grant of the household's TANF determination in force on as_of, else false. In force means the household's newest tanf row in program_determinations is approved, with effective_date ⇐ as_of and no expiration_date or one after as_of (tanf_determination_in_force). The grant is canopy-tanf's POST /v1/determinations/family-composition:batchGet for that determination and as_of's month, its members with receives_assistance, on canopy-eligibility's system token within the 3 s lookup deadline (read_tanf_grant). Members are joined by person_id to this request's roster; a unit member outside it sets nothing. With no determination in force every member is false. A failed database read, no registered canopy-tanf, a transport error, a non-2xx, the deadline, or an absent composition (a determination recorded before #3048) leaves it unknown for every member.

  • MemberContext.receives_ssi: the SOLQ record's ssi_active for a member the SOLQ selection picks (below). A selected member whose lookup gave no record is unknown. An unselected member is false, since SSI requires age 65 or over, blindness or disability (20 CFR 416.202). A self-reported ssi income record only selects the member; SOLQ alone decides the fact.

WIC (#3153). The WIC dispatch posts canopy-wic's own WicApplicationContext (canopy-wic), which mappers::wic::context builds from the household context. CAPS takes its own body too (below), and SNAP, TANF, Medicaid and CHIP take the generic context. Every member is a participant: canopy-wic derives each one's category and denies a member in none, so the orchestrator omits no one. A participant carries the member's person_id and date_of_birth, the expected_delivery_date, fetus_count and family_size_increase_waived of the member's open pregnancy (with none, the first two are null and the waiver false), the member's pregnancy_end_date, and empty adjunctive_certifications (#2365, #3312). The body is an evaluation on as_of, the run's legal day, with the context's household_size, homeless and jurisdiction, and gross_monthly_income the sum of the household's income amounts, each already monthly (#861; WIC's exclusions are #3155). The dispatch stamps the run's claimed operation_id and none of the generic context's provenance fields. WIC pends input_unsatisfiable with one persons missing input, and is not dispatched, when an income record's frequency was left unconverted (income[].frequency), so it never sees an understated sum. Self-employment counts net of business costs (7 CFR 246.7(d)(2)(ii)(B), #3164): a person's self_employment_net record is counted and their gross self_employment records are left out, the person being the only link between the two. Gross receipts whose person has no net record pend WIC the same way, naming income[].self_employment_net; the worker records the net figure and re-runs. It pends the same way on an income value that is not a canopy-persons income record (income[]), a sum past the decimal range (income[].amount), or a member whose person_id or date_of_birth does not parse (members[].person_id, members[].date_of_birth).

CAPS (#3186). The CAPS dispatch posts canopy-caps's own CapsApplicationContext (canopy-caps), which mappers::caps::context builds from the household's parent–child relations. The children are the members who are the child in a relation, and the parents the members who are the parent in one. Each is listed once, in roster order, and canopy-caps names a parent in a denial by that position. A child carries their person_id, their age_years and no provider_id; a parent carries their person_id alone. canopy-caps reads each parent's activity standing and each child's care need from its own records (#3183), so the body carries no worker fact. gross_monthly_income is the same monthly sum WIC's body carries (mappers::income), and eligibility_type is continued on an order run (the context's trigger is the order's) and initial otherwise. The dispatch stamps the run's claimed operation_id, which canopy-caps signs into every child's envelope and dedupes on (#3185). CAPS pends input_unsatisfiable with one persons missing input, and is not dispatched, when the relations name no child or no parent among the members (parent_child), a child has no age (members[].age), or an income record is not a monthly canopy-persons record (income[], income[].frequency, income[].amount).

Referential integrity (ADR-025). Before the eligibility_requests row is written — before the per-household admission lock, the stale sweep and the duplicate-admission 409 — the orchestrator proves both cross-service ids on the run’s bearers (the request’s outbound, as every context read below): application_id at canopy-applications (GET /v1/applications/{id}), then household_id at canopy-persons (GET /v1/households/{id}, which must return at least one member). An unknown id is 422, uncoded, detail {kind} {id} does not exist in the owning service; an owner that is unreachable or answers neither 200 nor 404 is 502, uncoded (fail loud, never a silent admission). Either refusal writes nothing. The interactive arm and the #1504 order self-call share the check (the order consumer classifies the 422 terminal and the 502 retryable); the #1213 bulk arm runs its own frozen-context path and is not covered. A member-less household is therefore refused here as 422 rather than after admission as 400; the 400 remains for a household admitted now but absent, or member-less, as of the evaluation date.

WIC certifications (#2365, adjunctive_certifications.rs). A run naming wic reads, before any claim, which members hold a certification in another program on the run's legal day, from the newest recorded determination of each program and subject, approved and in force. A household-level SNAP approval certifies the members canopy-snap lists (GET /v1/determinations/{id}/certified-members); a TANF approval, the members canopy-tanf's family composition has receiving assistance; Medicaid, CHIP and CAPS, the member the row names. Each is sent to canopy-wic as a full certification naming its determination, and canopy-wic decides what it confers. Any failed read refuses the run: 503 adjunctive_certifications_unavailable, naming the read. A run that does not name wic makes none of these reads.

Effective-date provenance. Every application-scoped run first reads GET /v1/applications/{id}/determination-context fail-closed (502 determination_context_unavailable; a 404 is a 404). A run naming snap without the bulk marker (the order self-call included) then makes the two household reads fail-closed (services/canopy-eligibility/src/enrollment_state.rs, read_enrollment_state): the live enrollment (GET {enrollment_url}/v1/enrollments/live?household_id=&as_of=<legal today> → LiveEnrollmentView: the covering row, else the not-yet-started upcoming row, #2339) and the in-force certification (GET {renewals_url}/v1/renewals/snap/certifications?household_id=; 404 = none, a lapsed row = none). Any transport error, deadline, non-2xx (other than that 404) or parse failure refuses the whole run 503 enrollment_state_unavailable, the detail naming the read; so does an upcoming row beside a covering one or one whose period has already started (enrollment_state::live_periods) — nothing is claimed or signed; the order ledger retries it. The benefit anchor is then derived per program from crate::derivation (services/canopy-eligibility/src/derivation.rs: DispatchArm, arm_for_program, LiveInputs, derive) with the precedence postponement-rows-pending → postponement → conversion → expedited certification (refused) → order (order_continuation for a live household or one whose approved period has not started, else order_effective) → reopen arm R → in-period recertification (recert_approval) → live or not-yet-started enrollment (interim_change) → reopen A/B → pend → interactive:

  • order_effective{order_ref} — an order against a household with NO live enrollment, covering or upcoming, pins the benefit date (back-dating included — a new enrollment); expedited_postponed{episode_id, generation, postponed_deadline, certification_months} — the snap block’s open, undetermined postponement whose rows are on record, benefit_effective_date = legal_filed_date; in_cert_conversion{episode_id, generation} — the released, claimed, unsettled conversion, benefit date legal-today; application_reopen{episode_id, cured_on, benefit_effective_date} (or recert_reinstatement on a recertification row) — the episode’s resolved anchor adopted verbatim; agency_fault_pending — a live (h)(3) pend; otherwise determination_day. evaluated_as_of is legal-today in every arm.

  • interim_change{certification_start_date, certification_end_date, reported_on, reopen_episode_id?} (continuation class) — the household holds a live, in-force enrollment: the live period is carried verbatim and re-priced in place, and the anchor is the first day of the effective month from derivation::interim_effective_month(reported_on, key, legal_today, period) — the report month when day(reported_on) ⇐ [snap.certification].interim_change_next_month_after_day (georgia 20, PAMMS 3715:97; 7 CFR 273.12(c)(1)), else the following month; never before the processing month (a late-processed report is restoration, #1113) and never after the last certified month. Liveness displaces determination_day (an initial row or a post-end recertification), agency_fault_pending and the A/B application_reopen (whose episode rides reopen_episode_id so the record-back still settles it); it never displaces recert_reinstatement, recert_approval (below), expedited_postponed or in_cert_conversion, and the order arm re-prices the live row under its own kind (order_continuation, next bullet). Not started yet (#3056). A household whose approved enrollment starts after legal today (the live read’s upcoming row) takes the same kind on that period, in every cell liveness displaces: the period is carried verbatim, and the anchor is the report-month rule’s month raised to the period’s first month, which is its start (interim_effective_month). canopy-enrollment’s continuation arm re-prices the row in place and re-mints the period’s pending issuances, as for an order (next bullet), so no second enrollment meets the one-live fence. A live household re-run without change_reported_on is 422 change_reported_on_required, covering or not yet started; an in-force certification still typed expedited is 422 certification_conversion_pending for every arm below the postponement and conversion rows, interactive and order alike.

  • work_sanction{order_ref, certification_start_date, certification_end_date, person_id, sanction_ref} (continuation class, #3219) — an order with trigger work-sanction (canopy-snap's finding or lift, canopy-snap API) against a household with a live or not-yet-started enrollment takes the order_continuation arm's anchor and its two refusals, and the basis names the member and the finding (the order's subject_person_id and subject_sanction_ref, carried on the order row since 20270321000000_determination_orders_subject.sql; the finding rides apart from origin.ref_id, so a re-staged order keeps its own dedup identity). A work-sanction order missing either is 422 work_sanction_order_without_subject, and one against a household with neither enrollment is 422 work_sanction_not_enrolled, both before any claim and terminal on the ledger: such an order would otherwise mint a first enrollment no application asked for.

  • order_continuation{order_ref, certification_start_date, certification_end_date} (continuation class) — an order (determination.requested::Order or the order self-call) against a household with a live, in-force enrollment (derivation::order_arm): the live period is carried verbatim and re-priced in place, and the anchor is the order’s as_of — the producer’s date (a change-report pipeline applies its own report-date rule before it publishes; change_reported_on is never read on this arm). Two refusals, typed and before any claim, checked in this order: 422 order_anchor_behind_processing_month when first_of_month(as_of) < first_of_month(legal today) (no basis mints a month behind its anchor — the back span is restoration, 7 CFR 273.17 / #1113) and 422 order_outside_certification when as_of is before the live certification_start_date or after the certification_end_date; the order ledger holds either terminal like every other 4xx (orders/mod.rs::classify_self_call, self_call_422). A re-execution of an epoch whose SNAP determination canopy-snap already holds adopts it before deriving, so neither refusal is computed from that determination’s own enrollment ([re-execution-probe]). The expedited refusal above still precedes the order arm, and an order under an open postponement or a claimed conversion stays conflicting_episodes. Not started yet (#2339). A household whose approved enrollment starts after legal today (the live read’s upcoming row) takes the same kind on that period: the period is carried verbatim, and the anchor is max(as_of, certification_start_date) (derivation::order_target). canopy-enrollment’s continuation arm then re-prices the row in place and re-mints the period’s pending issuances at the new allotment (continuation/remint.rs). A change reported before the period begins adjusts it rather than restarting it (7 CFR 273.12(c), 273.10(c)(3)), and the one-live fence never sees a second row. The two refusals read the order’s own date, so the upcoming period refuses exactly the dates its first day would. The interim-change row reads upcoming too (previous bullet, #3056). The rows liveness never displaces (recert_reinstatement, recert_approval, expedited_postponed, in_cert_conversion) ignore it, every program but SNAP never receives it, and the bulk consumer’s read_live_period treats such a household as not enrolled. A household with neither row keeps order_effective and a new enrollment, as before (tests/order_backdated_enrollment_test.rs; the live chain: tests/order_continuation_test.rs).

  • recert_approval{renewal_certification_end_date} (NOT continuation class) — a recertification application decided while its renewed period still runs (legal_today ⇐ renewal_certification_end_date, the end riding the determination context) anchors the NEW period at that end + 1 (7 CFR 273.14(e)(1), (b)(4); PAMMS 3710) — a full first month — whether the row is plain or under an (h)(3) pend, and whatever the live read said (the household is enrolled to that end by definition; no change_reported_on is needed). Arm R and the A/B episode keep their own anchors; after the end the row takes the existing arms (a post-end recertification is interim_change for a live household, legal-today determination_day otherwise). canopy-snap opens the period from the anchor behind 422 recert_anchor_mismatch; canopy-enrollment schedules the successor enrollment and canopy-renewals records the decision (canopy-enrollment, canopy-renewals).

  • The postponement and conversion rows are refused, never silently ranked, beside any other anchor source: 422 conflicting_episodes. A snap block still carrying postponement_pending_step (the postponement saga has not reached dispatch_determination) is refused pre-claim with 409 postponement_rows_pending. Block semantics and the record-back truth table: canopy-applications; the program-side re-verification of the signed basis: canopy-snap.

POST /v1/eligibility/determine/dry-run

Non-persisting: re-scores a household’s current facts as-of as_of against the baseline determination’s frozen policy bundle and pinned corpus (the renewals materiality and 130%-FPL screens), or, with target_policy { corpus_hash, params_digest }, against the named policy (the COLA preview the bulk surface composes with). SNAP only; its canopy-snap and canopy-persons reads ride the request’s outbound (a worker’s onward delegation, or a system caller’s system token). Request DryRunRequest — { baseline_determination_id, household_id, as_of, target_policy? }. Response DryRunResult — baseline / dry_run (VerdictRef { status, benefit_amount }, unsigned), corpus_hash, as_of, household_size, gross_monthly_income, gross_income_limit, and in target mode target_policy with the matched set’s effective_period. Write-free end to end; errors degrade to manual review, never a 500.

Reads

  • GET /v1/eligibility/requests/{id} → EligibilityRequest; GET …/requests/{id}/determinations → the request’s determinations of record, each a complete signed envelope (snapshot_hash, denial_reason_codes, previous_determination_id, trigger, policy_target, evaluated_as_of, program_extension) whose status and basis are exactly as signed. benefit_effective_date sits outside the signed payload: it is the dispatch’s anchor (the cohort case’s on the bulk arm), recorded only when the envelope signed an effective_date_basis. A quarantined envelope is never returned by this or any other read below (Quarantined envelopes).

  • GET /v1/eligibility/results/{application_id} → CombinedResult.

  • GET /v1/eligibility/case-status?household_id={hid}&program={slug} → CaseStatus, the newest program_determinations row for the household; the optional program scopes it to one program so a program-scoped label never shows another program’s outcome (CaseStatusQuery, api/handlers/reads.rs). 404 when the household (and program, if given) has no determination.

  • GET /v1/eligibility/determinations?household_id={hid}&limit={n}&offset={m} → the household’s program determinations as [ProgramDetermination] (the wire type in crates/canopy-contracts-eligibility/src/determinations.rs; the service’s store::models::ProgramDetermination row converts into it, advisories from the row's recorded column and absent when none, #3324; config_stamp, always present, is the configuration the program ran on as its envelope signed it, [{ name, sha }] per layer, #3261), newest first (determined_at DESC, id DESC), one offset page at a time (HouseholdDeterminationsQuery, api/handlers/reads.rs): limit absent → 50, any value clamped to 1..=200 (canopy_api::pagination::clamp_limit); offset absent or negative → 0 (clamp_offset); [] for a household with no determination (never 404). The remaining page consumers read it at limit=200 (canopy_api::pagination::MAX_LIMIT) and reduce client-side because each wants more than one row per program: the applications process page picks the newest row per (application_id, program) (fetch_determination_result, api/applications/process_reads.rs), the SNAP action resolvers apply their own selectors over the SNAP history (select_certifiable_determination / select_latest_snap_determination / select_appealable_determination, api/snap_determination.rs), and the applicant portal home walks every page (limit=200, offset advanced by the rows held — fetch_household_determinations, home.rs; at most DETERMINATIONS_MAX_PAGES = 10 pages, then a WARN) before taking the newest approved row per program after a per-member pre-pass (current_per_program / authoritative_rows) — #2194. The portal arm requires the signed ownership claim for the queried household.

  • GET /v1/eligibility/determinations?household_id={hid}&latest_per_program=true → the NEWEST determination per program, as the same [ProgramDetermination] shape: at most one row per program (DISTINCT ON (program) … ORDER BY program, determined_at DESC, id DESC in store::list_latest_determinations_by_household), the reduced set still ordered determined_at DESC, id DESC, [] for a household with no determination. Unpaged — limit and offset are ignored, because the row count is bounded by the program set rather than by a page, which is the point: a program whose newest row sits past the 200-row cap used to render "No determination" (#2178). Same route, so the same admission and portal ownership check (require_owned_household) apply. The reduction is per program, not per subject: Medicaid, CAPS and WIC write one determination row per person, and this read keeps only the newest of them per program — it is not a substitute for a per-member read (the portal home’s per-member pre-pass is why that caller does not use it). Dialled by canopy-web’s case-detail identity hero (build_identity_hero, api/case_detail/hero.rs) and the Determination tab’s SNAP strip (build_snap_group, determination_view.rs); build the query with canopy_contracts_eligibility::paths::latest_determinations_by_household, or call EligibilityClient::list_latest_determinations_by_household from tests.

Cross-program alerts

Rows derive from program_determinations with status ∈ denied, sanctioned (the table holds determinations of record only, so a quarantined envelope never surfaces). Both feeds take limit (clamped 1..=50, default 10) and repeated programs= keys (empty = unscoped; unknown → 422 naming the value).

  • The scoped feed filters to households the effective worker holds an active household_assignments row for (looked up live from canopy-applications, scope-then-limit). The effective worker is an opaque subject (#1008), resolved from the query’s URL-encoded subject by resolve_effective_worker and compared byte for byte, whatever its shape: caseworker / eligibility_specialist / quality_control read their own canopy subject — subject may be omitted, and naming anyone else is 403; supervisor / admin must name a worker (any, self included). The feed is user-only: a system caller is 403 service_class_on_user_only, and the assignment lookup carries the worker’s onward delegation. A required subject that is missing is 400 subject_required; an invalid one (empty, over 255 bytes, non-ASCII, a control character, or a repeated subject key) or an unknown query key is refused by the extractor (ScopedAlertsQuery, deny_unknown_fields) before any lookup. Fail-closed: applications unreachable, the 3 s deadline, or an assignment set over 5,000 is a coded 502 — never the unscoped list; a 5-failure breaker opens for 30 s. Each read publishes eligibility.cross_program_alerts.accessed, whose effective_worker is the resolved subject as a JSON string (null on the /all feed).

  • The /all feed never consults assignments (delegated::ELIGIBILITY_GET_ELIGIBILITY_CROSS_PROGRAM_ALERTS_ALL: a supervisor or admin delegation through any client, and a studio_admin one through canopy-web). Its query (AllAlertsQuery) is deny_unknown_fields, so a subject sent to it is refused rather than ignored.

  • Both retired spellings of the scoped feed return 404, with no alias: the pre-#596 /v1/eligibility/cross-program-alerts and the pre-#1008 /v1/eligibility/workers/{worker_id}/cross-program-alerts. Older replicas 404 the new path in turn, so a mixed deployment fails closed in both directions.

Quarantined envelopes

An envelope that does not verify, or verifies but does not bind to its dispatch, is written to quarantined_determinations and never to program_determinations (ADR-002 Amendment 5; #2061). No read above returns it. Three routes let a determination operator resolve one (api/quarantine.rs, src/quarantine_ops.rs; wire types in crates/canopy-contracts-eligibility/src/quarantine.rs). Each admits OPERATOR (Admission::user_roles(DETERMINATION_OPERATOR_ROLES): eligibility_specialist, supervisor or admin, through any client). A system caller is 403 service_class_on_user_only, and any other role 403 required_role_missing. canopy-web’s quarantined-envelope worklist is the worker surface: it calls these routes on the worker’s delegation.

Endpoint Behavior

GET /v1/eligibility/quarantined-determinations

One keyset page of open interactive envelopes, oldest first by (received_at, id). limit defaults to 50 and must be 1..=200 (422 invalid_limit); repeated programs= keys narrow to those program slugs (422 unknown_program); after_received_at + after_id is the cursor, both or neither (422 partial_cursor). Each item carries resolution_count and last_resolution; next_cursor is absent on the last page. Order- and bulk-owned, reverified, dismissed and superseded envelopes are never listed.

GET …/{id}

One envelope in any state and of any owner, with its newest 20 resolutions, newest first (item.resolution_count counts them all); 404 for an unknown id.

POST …/{id}/resolutions

{ "action": "reverify" | "dismiss", "note": "…" }. 201 ResolveQuarantineResponse — the ledgered resolution, and result (the promoted ProgramResult, rebuilt from the persisted row) when a reverify promoted the envelope. A repeated reverify of an envelope already reverified, including one that raced the promoting reverify, answers 200 with the earlier resolution and result and writes nothing — unless another row for the same household, program and subject, newer than the envelope, now exists in either table (the determination of record the promotion itself recorded excluded; the comparison is NULL-safe). That replay is refused 409 superseded, so a caller that records the replayed result back never writes an old verdict over a newer one. The note is stored trimmed; blank after trimming, over 500 characters after trimming, or holding a NUL is 422 invalid_note.

An item’s routing (program, eligibility_request_id, application_id, household_id) is canopy-eligibility’s own. claimed_determination_id is the id the envelope claims, stored in its own column (for D-2c bytes that do not parse as an envelope, the id they were fetched under); person_id and claimed_status are read from the stored signed bytes. None of the three has been accepted unless state is reverified. state is derived, never stored: reverified (a reverify promoted it), dismissed, superseded (a newer row for the same household, program and subject exists in either table), otherwise open. owner is interactive, order or bulk.

A resolution runs in two phases:

  1. Checks, with no transaction open. The envelope’s owner and state decide the first refusals: 409 order_owned and bulk_owned (the order and bulk ledgers own those envelopes), 409 not_open (any state but open, except the repeated reverify above, which replays or is refused superseded), and 409 not_reverifiable for a reverify of a provenance_rejected envelope (its bytes verified and cannot bind on a second look). A reverify then verifies the stored signed_payload against the stored signature under the trusted program’s signing key (chip → medicaid) and re-runs the binding.

  2. One transaction. It compare-and-sets the envelope’s revision; a stale revision (another resolution committed since the checks read the envelope) writes nothing and re-reads the envelope: a reverify that lost to a promoting reverify answers that promotion like the repeated reverify above (200, or 409 superseded, #2653), and every other loser is 409 concurrent_resolution. It appends a quarantine_resolutions row: actor is the caller’s canopy subject (principal.attribution_sub()), authz_basis the highest operator role it holds (role:admin, role:supervisor or role:eligibility_specialist), note the trimmed note. It stages determination.quarantine_resolved through the outbox, naming the caller as resolved_by (principal.actor()). A reverify that does not verify or bind records its new reason as reason_after and on the envelope, and leaves it open.

A reverify that verifies and binds also promotes the envelope, inside the same transaction. It is refused while an unsettled determination_operations claim holds the application and program (409 determination_in_flight), once the envelope is superseded or its request already holds a determination of record for that program and subject (409 superseded), and when the envelope signed an effective-date basis whose operation claim, which holds its anchor, does not exist (409 anchor_unavailable). Every program signs its operation, so the binding has already quarantined an envelope naming none (#3197). Otherwise it records the envelope through intake’s persist path, so the projection pin and conflict rule apply (409 envelope_conflict, also when the signed operation is already recorded; duplicate_in_response; unrepresentable_envelope). It then moves one programs_pending entry naming the program (matched case-insensitively) to programs_approved or programs_denied in the request’s newest combined result, under that row’s lock. An approval adds its benefit to total_monthly_benefit, and a Medicaid promotion fills an empty medicaid_assigned_group from the signed assigned_coa. No combined result holding the program as pending is 409 not_pending. A promotion re-evaluates no facts: the operation’s outcome, the request’s status and determination.completed are left as they were. Recording the envelope stages determination.recorded.<program>, which releases the events the program service held for it (Determination verdicts (#2322)).

A dismiss also verifies the stored bytes against the stored signature in the checks phase, with no lock held. When they verify, its transaction stages determination.disowned.<program> with reason dismissed, and the program service drops the events it held for the claimed determination. Bytes that do not verify stage nothing.

Held determination events

A program service holds a determination’s completion events until canopy-eligibility records it (Determination verdicts (#2322)), so one never recorded holds them for good (ADR-002 Amendment 8; #3065). Three routes let a determination operator find them, drop them, and adopt the ones an order binds (api/held.rs, src/held_ops.rs and src/held_ops/adopt.rs; wire types in crates/canopy-contracts-eligibility/src/held.rs). Each admits OPERATOR, the quarantine routes' gate. The procedure is the held-determination runbook.

Endpoint Behavior

GET /v1/eligibility/held-determinations

Reads the GET /v1/held-determinations of the named program with the caller's onward delegation, so the read is the operator’s (delegated::<SVC>_GET_HELD_DETERMINATIONS). The page passes through: each hold past the program’s warning age, oldest first, its next cursor, and after and limit as the program takes them (validated here first). canopy-medicaid serves Medicaid and CHIP, so program=medicaid and program=chip read the same page, each item naming its own program. Each item gains a disposition (HeldDisposition), the first that applies: recorded (a determination of record has its id: an anomaly), resolved (the ledger already adopted or dropped it; its verdict is in flight), quarantine_open (an open quarantined envelope claims it), adoptable (SNAP, Medicaid or CHIP, and the reported operation_id is a determination_operations claim), else drop_only. A program service that does not answer, or no CANOPY_PROGRAM_URL_<PROGRAM>, is 502 program_unavailable.

POST …/{determination_id}/drops

{ "program": "…", "note": "…" }. The note is checked first (422 invalid_note, as for a resolution). The named program is asked for the id alone (502 program_unavailable); unless it reports the id, as that program, past its warning age, the drop is 409 not_held. Then one transaction takes the id’s advisory lock and refuses, writing nothing: 409 recorded, quarantine_open, already_resolved, and determination_in_flight (the reported operation’s claim is unsettled and younger than the staleness TTL, or its order or cohort case is not terminal). Otherwise it appends a held_determination_resolutions row (actor, authz_basis and note as for a quarantine resolution; created_at the request’s decision-clock instant), stages determination.disowned.<program> with reason operator_dropped, and stages determination.held_resolved. 201 HeldResolution. No signature is checked: a drop only suppresses events.

A dropped id is never recordable. store::record_determination_on takes the same advisory lock and refuses an id the ledger dropped, so intake, an order replay, a promotion and the bulk arm answer the program pending envelope_conflict with detail determination_dropped (a promotion: 409 envelope_conflict).

Adoption

POST /v1/eligibility/determination-operations/{operation_id}/adoptions with { "note": "…" } adopts the held determinations of one of canopy-eligibility’s own operations: the program’s signed envelopes become the determinations of record, and their determination.recorded.<program> verdicts release the held events. The path names eligibility’s DeterminationOperationId (the operation_id a held item reports), so the routing comes from the claim ledger, never from an envelope. The claim’s eligibility_request_id names the run that claimed it, or the newest re-execution of an order epoch. The adopt set is held_ops::adoptable_program: the service signs back its operation and serves the operation read. Today that is SNAP, Medicaid and CHIP; TANF waits for #3116 and a TANF operation read, and WIC, which signs its operation since #3158, for a WIC operation read, so a WIC hold stays drop-only.

The note is checked first (422 invalid_note). The checks phase holds no transaction. It refuses an unknown operation, such as a direct caller’s or the bulk arm’s (404), and then these, each a 409:

  • operation_unsigned: the program is outside the adopt set.

  • request_unknown: the claim names no request (claimed before #3065) or a missing one.

  • order_retrying: the owning order is not terminal; its re-execution adopts by replay.

  • determination_in_flight: the operation’s own claim is unsettled and younger than the staleness TTL.

It then reads the operation’s envelopes from the program service with canopy-eligibility’s system token: canopy-snap’s …/envelope, canopy-medicaid’s …/envelopes. A failed read is 502 program_unavailable, and an operation with no determination is 409 operation_not_determined. Each envelope must be the canonical bytes of what it parses to (envelope_malformed). It must verify under the program’s signing key (signature_unverified, the detail naming the reason) and bind to the trusted routing: the claim’s program and application, the request’s household, and the operation (provenance_rejected, the detail naming the field). An envelope a quarantine row claims, in any state, is refused quarantined.

One transaction then takes each determination’s advisory lock in id order and refuses, in order:

  • operation_in_flight: a live claim holds the application and program.

  • superseded: a determination of record or quarantined envelope for the household, program and subject answers a request admitted after the operation’s request.

  • already_resolved: the ledger already adopted or dropped one of the determinations.

  • already_recorded: every determination is already recorded.

It then records each unrecorded envelope through a promotion’s path. The benefit effective date is the claim’s anchor, and the refusals are a promotion’s: superseded, envelope_conflict, duplicate_in_response, unrepresentable_envelope, anchor_unavailable. One reconcile of the request’s newest combined result follows: every programs_pending entry naming the program is removed, and one entry per adopted determination is filed under a promotion’s benefit and Medicaid-group rules. No combined result holding the program as pending is 409 not_pending. Each adopted determination appends an adopt row to held_determination_resolutions (naming the operation and the request) and stages determination.held_resolved. The answer is 201 HeldResolutions, one resolution per determination; canopy-medicaid signs one per subject. A refusal writes nothing; the operator then drops (Held determination events). As with a promotion, the operation’s outcome, the request’s status and determination.completed are left alone, so a consumer that settles on determination.completed does not see the adopted outcome (#3119).

Bulk cohort runs

The October-COLA mass re-determination surface (ADR-002 Amendments 1 and 3). Schemas: docs/modules/ROOT/openapi/eligibility.json; codes ride ProblemDetails.code. Every bulk POST refuses an Idempotency-Key (400 idempotency_key_not_allowed) and requires a reason of 1..=500 chars (valid_reason, 422 invalid_reason) recorded on the action ledger. The reads and the pause / cancel controls are live even when CANOPY_ELIGIBILITY__BULK_RUNS_ENABLED is off. Operations: the bulk-COLA runbook.

Endpoint Behavior

POST /v1/eligibility/bulk-runs

Create a run (trigger=cola, programs=["snap"]): freezes the live corpus + snap parameter provenance into expected_policy_target, and the configuration canopy-snap runs on (the config_stamp its GET /v1/params/provenance reports) into expected_config_stamp (#3261); enforces as_of = window start, one active run, same-target dedup, the cohort ceiling and a non-empty floor. Materialization admits the frozen universe rows as cases EXCEPT those whose certification_type is expedited (a provisional postponed-verification period; its conversion prices under the effective figures) — counted on the run as excluded_expedited (bulk/worker.rs admit_universe_page); each case’s baseline_determination_id is the certification’s chain head (continued_by_determination_id) when it has one, else its establishing determination, so a second annual COLA supersedes the first COLA’s determination (#806 U-C). A universe whose every row is excluded fails the run cohort_all_excluded.

GET …, …/{id}, …/{id}/failures, …/{id}/actions

Keyset pages; full status (counts, excluded_expedited, canary, breaker window); seq-keyset failures with successor_determination_id; the append-only action ledger.

POST …/{id}/enact

The fail-closed gate ladder: enabled → downstream sign-off (bulk_enact_accept_downstream) → previewed state → audited clean-preview override → full-target preflight (corpus + provenance equal the pin, else 409 policy_target_drift; canopy-snap's configuration stamp equals expected_config_stamp, else 409 config_stamp_drift naming both; api/bulk_runs_gate.rs frozen_pins_hold) → attestation_enabled → snap legal-today ≥ as_of (409 enact_too_early) and inside as_of's calendar month (409 enact_outside_effective_month — a COLA enacts inside its effective month so at most one issued month is re-priced, 7 CFR 273.12(e)(3)(i); a run that missed its month is not enacted late, a new run is; api/bulk_runs_gate.rs enact_date_gate, called from enact_preflight) → re-arm (fresh epoch, generation, canary, watermark, deadline).

POST …/{id}/pause, …/{id}/cancel

Incident controls; cancel drains — claims settle before the run terminalizes.

POST …/{id}/resume, …/{id}/retry-failures

Resume restores paused_from; retry re-arms terminal failures under a fresh epoch, re-running the enact ladder and re-acquiring the single-active slot atomically (a typed 409 on loss).

The per-case live read (#806). After the consumer’s CAS claim (bulk/store.rs claim_attempt, which mints the operation id only) and before either phase, it reads the household’s live enrollment covering the run’s as_of from canopy-enrollment (GET /v1/enrollments/live, enrollment_state::read_live_period, the CANOPY_ELIGIBILITY__ENROLLMENT_URL upstream) and freezes the case’s provenance write-once (freeze_provenance): effective_date_basis = mass_change_cola { certification_start_date, certification_end_date } — the live period, which canopy-snap signs verbatim and canopy-enrollment applies in place — and benefit_effective_date = as_of. The outcomes settle through the fenced settle_case and surface on …/{id}/failures as last_error_code: no live row → terminal no_live_enrollment_on_effective_date (nothing to re-price; a household enrolled later belongs to a new run); a failed read → retryable live_enrollment_read_failed (the existing backoff); at enact, a live period that differs from the one frozen at preview → terminal certification_changed_since_preview — retry-failures keeps the frozen basis, so a retry cannot fix it; recovery is a NEW run (bulk/consumer.rs provenance_step). At enact either terminal refusal answers only once canopy-snap holds no determination under the case’s operation (#2655): such a refusal can be computed from the downstream effect of the case’s own determination — an earlier execution whose determination snap committed but the arm never ledgered (a lost response body, a quarantined signature, a failed persist) and canopy-enrollment applied. So for a case whose snap context was ever frozen (the arm freezes it before it dispatches), the consumer first reads the operation’s envelope (GET {snap_url}/v1/determination-operations/{operation_id}/envelope, operation_determined; the program registry’s snap URL): found, it dispatches instead, and the frozen key replays the determination or meets operation_already_determined / supersession_conflict, which the arm adopts and ledgers — snap’s one-determination-per-operation index means that dispatch can never sign another; answered the coded 404 operation_not_determined, the refusal settles; any other answer (a bare 404 included) settles retryable operation_probe_failed.

The single-case order substrate

determination.requested is a two-arm payload: Cohort (the bulk shape) and Order — a RequestOrigin {source, ref_id}, subject, programs, pinned as_of, signed trigger, requested_by. Program services publish orders (canopy-medicaid’s CMD first, origin medicaid-cmd); the consumers attach on every boot (CANOPY_MQ_PREFETCH_COUNT=1 is a fleet-wide boot requirement) and execute each order once on the determination_orders ledger — idempotent on UNIQUE (origin_source, origin_ref), claim-token-fenced settles, backoff retry via the 1-minute sweep (attempt cap 12), definitive-result adoption on crash recovery. A program is determined for the order once any completed run carrying its origin answered it approved or denied, whichever epoch dispatched it (orders::store::order_coverage, #2688). The run must also list no pending result for the program, since pending wins (OriginRun::answered, #3012). canopy-medicaid signs one envelope per subject, so a run that approved one member and left another pending lists medicaid both approved and pending, and the program stays undetermined. The next execution dispatches it again on the same epoch, because a pending member’s intake failure (signature_quarantined, persist_failed) retries the epoch rather than bumping it. The same operation’s replay, or its read-back after operation_already_determined (#2673), returns the approved member’s envelope rather than a new determination. Re-landed on the new run, that envelope answers from its row of record (store::record_determination_on). Every execution, on the same epoch or a re-keyed one, dispatches only the programs still undetermined, so a program is never sent again under a new key (ADR-002 §4: one determination per order and program). An order with every program determined settles succeeded without a dispatch, on the newest run that answered one of them, and so does a run that answers the last undetermined programs. Each run’s determination.completed lists only the programs that run dispatched, so a requester of a multi-program order reads the order’s outcome across its runs' completions; no program is answered approved or denied by more than one of them. One order epoch is one operation per program (#2652): the epoch’s first execution mints each program’s operation id (UUID v7) and stores it on the order ledger (determination_order_operations, keyed by the order’s origin, the epoch and the program; orders::store::epoch_operations); every re-execution of the epoch reads it back and claims it, re-opening the settled claim an earlier execution of the epoch left whatever its outcome — a run that died (reaped abandoned), whose completion failed, or that completed without a definitive result while its self-call answer was lost (self_call_transport / malformed_self_response retry the epoch without a bump). A re-execution therefore sends the same operation_id under the same Idempotency-Key, and with an unchanged context the same body (the SOLQ records ride in person_id order), which the program’s idempotency layer replays. A program that answers the epoch’s key idempotency_body_mismatch reached that program with another body in an earlier execution. Its idempotency layer answers from whatever it holds under the key. That can be a committed determination, but also a cached 4xx refusal, a 5xx in cooldown or a claim an earlier execution abandoned. canopy-snap’s and canopy-medicaid’s mismatch is resolved by the epoch operation’s read (#2676, #2673):

  • the determinations found there are adopted, as on a replay;

  • operation_not_determined re-keys the epoch (dispatch_body_mismatch_undetermined), since nothing was signed under the key;

  • any other answer retries the epoch.

Every other program serves no operation read, so its mismatch settles the order failed_terminal with code dispatch_body_mismatch and no epoch bump, because the earlier execution may have committed a determination, which a new key would let it sign twice. A completed self-call settles through the D-5 matrix the bulk consumer shares (#2672), so the epoch bumps (re-keying the next execution) only for an answer that proves nothing was committed under the key: a pending result with no failure (non_definitive_completion), a verdict with no determination id (definitive_without_id), a canopy-snap or canopy-medicaid body mismatch whose operation has no determination (dispatch_body_mismatch_undetermined), or canopy-medicaid’s 409 supersession_conflict to a medicaid or CHIP dispatch (supersession_conflict: medicaid’s persist is one transaction, so the 409 rolled back, and its idempotency layer caches that 409 for 24 hours, so only a fresh key re-resolves the current prior). Every other program failure keeps the epoch: transient_upstream (a timeout or transport failure, after which the program may have committed), breaker_open, signature_quarantined, persist_failed, upstream_conflict (any other 409, canopy-snap’s supersession_conflict included: on a pinned dispatch its successor can be the dispatch’s own committed determination), policy_pin_rejected and superseded_without_successor retry the same epoch, so a determination the program committed before its answer was lost is replayed by its idempotency layer rather than signed again (a cached 409 replays until attempts_exhausted); unconfigured, terminal_rejection, contract_violation, envelope_conflict and upstream_superseded (a superseded-baseline failure, which only the bulk arm reports) settle failed_terminal. Across the order’s programs (and a program’s per-subject results) the most severe settle wins: terminal over a same-epoch retry over a bump; a program with no result retries the same epoch (malformed_self_response). The settle’s excerpt names the failing program. determination.completed echoes the order’s origin; the order self-call pins the order’s date as the benefit anchor — under order_effective (a new enrollment) for a household with no live enrollment, under order_continuation (the live row re-priced in place; 422 order_anchor_behind_processing_month / order_outside_certification when the date is a month behind the processing month or outside the live period, both terminal on the ledger) for a household with a live, in-force enrollment or an approved one whose period has not started (anchored at that period’s start; the effective-date provenance paragraph above). Operations: the CMD change-report rollout runbook.

SSA pre-dispatch (Medicaid, CHIP and SNAP)

When a request includes a program canopy-medicaid serves (medicaid or chip) or snap (#3322), the orchestrator queries canopy-verification’s POST /internal/v1/ssa/solq for each member aged 65+, with disability_status ∈ disabled | disabled_veteran | ssi_recipient, or named by an income record of type ssi (member_facts::needs_solq_for). It forwards the records to canopy-medicaid as ApplicationContext.ssa_solq without persisting them (ADR-004 — raw SOLQ lives only in canopy-medicaid); a SNAP-only run carries no ssa_solq, and SNAP receives only each member's receives_ssi. CANOPY_ELIGIBILITY__VERIFICATION_URL enables it (unset: skipped, and the ABD SSA-linked COA gates fall back to their defaults); development never dispatches it whatever the URL, logged at boot (pre_dispatch_base_url, main.rs; #2495). The queries ride the run’s bearers (the request’s outbound). Fetch failures degrade to None per member. The real SSA transport is no longer an eligibility-side change: the archived plan is superseded by ADR-045 — the connector lands in canopy-exchange (#1544; live connectivity #1559) and this pre-dispatch stays on the Noop adapter until then.

TANF deprivation and relations

The orchestrator sends canopy-tanf no deprivation basis: nothing captures one yet (#669), and since #3509 it infers none. deprivation_type and deprivation_verified stay on the context for a captured basis and are absent until capture exists. The pack's tanf-eligibility decision says whether its own rule gives the unit a provisional basis (the TANF decisions). dependent_children is no longer sent.

The context also carries parent_child (required, #3048): the household’s parent–child relations, read with the parent_child group of the household’s GET /v1/households/{id}/full (fetch_household_context), each {parent_person_id, child_person_id, kind} once although canopy-persons lists it on both members' bundles (household_edges). canopy-tanf composes its assistance unit from them; the other program services ignore the field.

WARNING
A basis a pack's decision infers is provisional and is signed as such. Real TANF deprivation (45 CFR Part 261) is multi-factor and worker-verified; explicit intake capture replaces any inference before production (#669).

Signature verification

For each returned envelope both dispatch paths (orchestrator.rs intake_envelope, bulk/arm.rs; src/quarantine.rs) compute the canonical signing bytes (SignableDetermination::canonical_signing_payload()) once. That one buffer is verified and stored. Each envelope then goes through three steps:

  1. Verify. VerifyingKeyRegistry::verify_with_history(key_program, bytes, signature) returns a SignatureCheck, and every outcome but Verified quarantines the envelope with its reason: Malformed → signature_malformed, UnknownKey → key_unknown, KeyLookupFailed → key_unavailable, Mismatch → signature_invalid. The key program (ProgramServiceRegistry::key_program) is the dispatched program, except that a chip dispatch verifies under canopy-medicaid’s medicaid key. It picks the key and nothing else (ADR-002 Amendment 6, #2319).

  2. Bind. The claimed program must be the dispatched program (canopy-medicaid signs program: chip for a CHIP dispatch), the claimed application and household the request’s, and a SNAP or TANF envelope must name no subject. A SNAP envelope (#2947), a TANF envelope (#3116), a WIC envelope (#3153), a CAPS envelope (#3185), and the envelope of a program canopy-medicaid serves (medicaid, chip), must also sign the operation the dispatch claimed: another operation, or none, does not bind, and a dispatch that claimed none binds no such envelope. Only a program whose service signs and dedupes its operation may be dispatched (ADR-002 Amendment 6); every program’s service now does, CAPS since #3185, so every program is dispatched (CAPS since #3186). The bulk arm also checks the case’s supersession link and the run’s pins. A mismatch quarantines the envelope as provenance_rejected (detail provenance_rejected: <field>, e.g. program or operation_id). The quarantine row keeps the dispatch’s claimed operation (dispatched_operation_id), so a reverify binds the same operation; a row with none (written before #2319) fails reverify provenance_rejected.

  3. Record. A verified, bound envelope is inserted into program_determinations under trusted routing. Its columns, as stored, must re-canonicalize to its bytes (else contract_violation, unrepresentable_envelope). An existing row under the same id must hold the same bytes, signature and routing (else envelope_conflict); a repeat from the same request is envelope_conflict with detail duplicate_in_response.

A quarantined interactive or order program pends with failure signature_quarantined (detail: the reason) or contract_violation (detail provenance_rejected: <field>); a failed quarantine write is persist_failed. An envelope whose bytes cannot be built, or whose signature holds a NUL, is contract_violation with no row. Only determinations of record enter the combined benefit total. Every quarantine row increments canopy_eligibility_determinations_quarantined_total{program,reason}.

Operation replay (#2439, #2673). canopy-snap, and canopy-medicaid for a Medicaid or CHIP dispatch, answer a dispatch whose operation already has a determination 409 operation_already_determined — an order’s same-epoch re-execution (#2652) reaching the service past its idempotency layer. The orchestrator then adopts those determinations as the dispatch’s answer — reachable on the order arm only: an interactive run mints a fresh operation per run and dispatches it once, so it never meets the code: it reads the operation’s envelopes (GET {snap_url}/v1/determination-operations/{operation_id}/envelope, or canopy-medicaid’s …/envelopes, every subject’s, ordered by subject; under canopy-eligibility’s own system token, the run config’s system) and takes each fetched envelope’s bytes through intake. canopy-medicaid signs the dispatch’s one operation on every subject’s envelope, and program_determinations_operation_subject_uq holds one row per operation and subject (a household program’s subject is NULL: one row per operation). They must be the canonical bytes of the envelope they parse to (else quarantined signature_malformed, contract_violation; bytes naming no envelope are contract_violation with no row), and they are verified and bound like a returned envelope, the operation included (another operation’s envelope is provenance_rejected: operation_id), before they are recorded. A failed read pends classified like the bulk arm’s successor reads — a 404 terminal_rejection (operation_envelope_missing: <operation_id>), an availability failure transient_upstream — with upstream_code operation_already_determined, as is any intake refusal of the adopted bytes; the order ledger never bumps the epoch on such a result (a new key would let snap sign again): a read that was unavailable, a signature that did not verify or a failed write retries the same epoch (operation_adoption_pending), anything else settles failed_terminal (operation_adoption_failed). Every other program 409, supersession_conflict included, stays upstream_conflict here; the order ledger then re-keys only canopy-medicaid’s supersession_conflict (#2672) and retries every other on the same epoch.

Re-execution probe (#2675). The order arm’s derivation reads the household’s live enrollment, which a SNAP order’s own first execution can change: canopy-snap stages determination.completed.snap with its determination, canopy-enrollment enrolls the household, and a re-derivation then refuses a back-dated order 422 order_anchor_behind_processing_month (terminal on the ledger) or derives order_continuation and sends another body under the epoch’s key. So before deriving, a run carrying an order and snap looks up the epoch’s SNAP operation (orchestrator::probe_epoch_operation). When an earlier execution of the epoch claimed it (orders::store::claimed_epoch_operation; an execution claims before it dispatches), the run reads canopy-snap’s determination under it (GET {snap_url}/v1/determination-operations/{operation_id}/envelope, under the run config’s system token, counted on SNAP’s breaker):

  • found, SNAP is neither derived nor dispatched: the run claims the operation again under the provenance it was claimed under, and takes the envelope through intake as an adopted replay envelope, verified, bound (the operation included) and quarantined on any failure, as above;

  • the coded 404 operation_not_determined: the derivation runs, and a refusal it makes stands;

  • any other answer (a bare 404 included), an open SNAP breaker or no registered SNAP service: the run is refused 503 operation_probe_failed before any claim, which the order ledger retries on the same epoch (self_call_503). The probe could not rule out the epoch’s own determination, so the terminal refusal is withheld, as the bulk arm’s enact probe withholds its own (#2655).

Only SNAP is probed: no other program’s provenance reads live state (live_inputs_for).

Error codes

Code Meaning

400

actor_header_retired (an X-Canopy-Actor header); missing application_id / household_id, empty programs; an admitted household with no members or absent as of the evaluation date; order_and_bulk_markers, bulk_generation_header_missing; idempotency_key_not_allowed on a bulk POST; subject_required, an invalid subject or an unknown query key on the alerts feeds

401

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

403

The admission refusals: required_role_missing; service_class_on_user_only (a system caller on a user-only route); service_not_allowlisted / system_caller_required (a determine marker from anyone but canopy-eligibility’s system token); portal_on_non_portal_route, portal_scope_missing; ownership_claim_missing, ownership_mismatch (the portal’s household read). Uncoded: a caseworker-tier subject naming another worker on the scoped feed. downstream_not_accepted on enact and retry-failures without the downstream sign-off (CANOPY_ELIGIBILITY__BULK_ENACT_ACCEPT_DOWNSTREAM)

404

Request, combined result, baseline determination, bulk run, household case-status or quarantined envelope not found

409

postponement_rows_pending; determination_operation_open; an Idempotency-Key reused with a different body; bulk-run state refusals; the quarantine resolution refusals order_owned, bulk_owned, not_open, not_reverifiable, concurrent_resolution, superseded, determination_in_flight, anchor_unavailable, envelope_conflict, duplicate_in_response, unrepresentable_envelope, not_pending; the held-drop refusals not_held, recorded, quarantine_open, already_resolved, determination_in_flight; the held-adoption refusals (Adoption)

422

conflicting_episodes; certification_conversion_pending, change_reported_on_required, order_anchor_behind_processing_month, order_outside_certification; an application_id / household_id unknown to its owning service, a member-less household included (ADR-025, uncoded, before any row is written); dry-run baseline / corpus refusals; unknown programs slug (unknown_program on the quarantine list); invalid_reason; invalid_note, invalid_limit, partial_cursor, invalid_cursor

502

determination_context_unavailable; an owning service unreachable during the pre-admission ADR-025 probe (uncoded, before any row is written); a program service unreachable (breaker open); applications_unreachable / assignment_set_too_large on the scoped feed; program_unavailable (a held-determination route’s program read, or an adoption’s operation read)

503

enrollment_state_unavailable (a SNAP run’s household reads); adjunctive_certifications_unavailable (a WIC run’s certification reads, [wic-certifications]); operation_probe_failed (an order re-execution’s probe of its epoch’s SNAP operation, [re-execution-probe]); bulk_runs_disabled (a bulk write while the bulk core is off); keys_unavailable (no trustworthy key set in time)

Events

Published (crates/canopy-contracts-eligibility/src/events.rs; the verdicts in verdicts.rs): determination.completed (DeterminationCompletedV1, staged with the combined result; echoes an order’s origin), determination.requested (the bulk cohort dispatch), determination.order_failed (ids + machine failure_code only), determination.quarantine_resolved (DeterminationQuarantineResolvedV1, staged with each resolution’s ledger row: the resolution, request, application and household ids, the trusted program, the action, reason_before and reason_after, the promoted determination_id, and the operator as resolved_by, an Actor from the bearer that canopy-security records as the audit row’s actor; no domain consumer), determination.held_resolved (DeterminationHeldResolvedV1, staged with each held resolution’s ledger row: the resolution, the action, the program, the determination, an adopt’s operation and request, and the operator as resolved_by, an Actor from the bearer that canopy-security records as the audit row’s actor; no domain consumer), eligibility.cross_program_alerts.accessed (the scoped-feed audit, ids only), and the per-determination verdicts below. Consumed: determination.requested (both arms, on queues canopy-eligibility.bulk-redetermination and the order substrate).

Determination verdicts (#2322)

Two verdicts per program tell the program service what became of a determination it signed (ADR-002 Amendment 7). Each carries .with_programs([program]) and ids only. The broker admits them from canopy-eligibility’s login alone (devstack/rabbitmq/definitions.json).

Key Payload Staged

determination.recorded.{snap,tanf,medicaid,chip,caps,wic}

DeterminationRecordedV1: determination_id, the dispatched program, eligibility_request_id, application_id, household_id, person_id (absent for a household program), the persisted status, and, each absent when the row holds none, denial_reason_codes, benefit_effective_date, effective_date_basis, operation_id and origin (the order the request served, read from the request row; absent for a request no order placed) (#3202)

By store::record_determination_on, in the transaction that records the determination of record, from the persisted row: interactive and order intake, the #2673 read-back adoption, the bulk arm, a quarantine promotion and a held adoption (Adoption). An identical re-land stages it again.

determination.disowned.{snap,tanf,medicaid,chip,caps,wic}

DeterminationDisownedV1: determination_id, program, and a DisownBasis flattened beside them: reason with its record, provenance_rejected or dismissed with quarantined_id, or operator_dropped with resolution_id

By quarantine::quarantine_bytes with the quarantine row, for provenance_rejected only; by a dismissal’s transaction when the stored bytes verify; by a held drop’s transaction (Held determination events). A quarantine for any other reason stages nothing.

The program services consume them on canopy-<service>.determination-verdicts (each program page’s Events section).

Configuration

CANOPY_ELIGIBILITY{PERSONS_URL, APPLICATIONS_URL, ENROLLMENT_URL, RENEWALS_URL, VERIFICATION_URL, SECURITY_URL, RULES_URL, SELF_BASE_URL, BULK_RUNS_ENABLED, BULK_ENACT_ACCEPT_DOWNSTREAM} and the BULK_* sizing knobs (services/canopy-eligibility/src/config.rs); ENROLLMENT_URL and RENEWALS_URL (config/canopy-eligibility/default.yaml: http://canopy-enrollment:8006, http://canopy-renewals:8007) are REQUIRED and boot-validated like APPLICATIONS_URL — the household reads' targets — and the boot also refuses a pack jurisdiction.toml whose [snap.certification].interim_change_next_month_after_day is missing or outside 0..=31 (orchestrator::load_interim_change_cutoff_day); the unprefixed program registry CANOPY_PROGRAM_URL_{SNAP,TANF,MEDICAID,CHIP,CAPS,WIC} (src/registry.rs); CANOPY_MQ_PREFETCH_COUNT. VERIFICATION_URL enables the SSA SOLQ pre-dispatch outside development only (#2495). Identity settings are the baseline IDENTITY_ISSUER / IDENTITY_INTERNAL_URL (configuration reference), the service’s client key CANOPY_ELIGIBILITYIDENTITY_CLIENT_PRIVATE_KEY (it sends, and does not boot without its sender) and the portal’s applicant-claim verifier CANOPY_ELIGIBILITY__APPLICANT_VERIFYING_KEY (config.rs RESERVED_KEYS).

Edit this page · default