canopy-web API Reference
For a contributor working on the worker-portal BFF: every route canopy-web mounts, the gate each runs under, and the upstream call it makes. Caseworker workflow is the SNAP Caseworker Guide; the page surfaces are Worker Portal Screenshots; the colour tokens are the Orchard Design System.
/v1/composition/*) is documented by the CompositionApi document at GET /api-doc/openapi.json. That document is committed as docs/modules/ROOT/openapi/web.json and checked against what the service serves by a unit test, which cargo xtask api-docs --offline also runs (canopy_web::openapi::served).
- Base URL
-
canopy-web’s public origin,
CANOPY_WEB__PUBLIC_ORIGIN(alwayshttps; on the devstackhttps://web.canopy.test:<port>, served by theingressTLS proxy in front of container port 8080) - Authentication
-
A canopy-identity web session (ADR-049 Amendments 18 and 19). A worker signs in at the deployment’s one upstream identity provider (Kanidm on the devstack) through canopy-web’s relying party; canopy-identity federates the upstream’s answer into a session, and canopy-web’s session engine keeps it fresh and serves each request (
auth::serve::serve_session). An unauthenticated request to a protected route is redirected to/login?return_to=…(middleware::require_auth); a request whose session store cannot be read, or whose stale session’s maintenance has not finished within the page budget, answers 503 withRetry-After: 5instead. - Session
-
canopy-web’s own PostgreSQL store (ADR-009 Amendment 2; tables on the data model). The
session_contextlayer, outermost on the protected and composition routers, loads the session the cookie names once per request. Sliding idle deadline of 8 hours by default (CANOPY_WEBSESSION_TTL_SECONDS, floor 300 s, read at boot), slid when less than the deadline less a minute is left; whatever its idle deadline, the engine ends the session, loggedexpired, once it can no longer be kept fresh, at the latest at the federated session’s own end. Cookies:Host-canopy_session(SameSite=Strict, a browser-session cookie),Host-canopy_login_flow(SameSite=Lax, 900 s, the flow in flight) andHost-canopy_reauth(SameSite=Lax, 30 days); allHttpOnlyandSecure, always. - Database
-
canopy_web— sessions, the composition-override layers (ADR-022) and the event outbox/inbox; no benefit-domain data (canopy-web Data Model). - Outbound identity
-
Every call a request handler makes, read or write, presents the worker’s delegation: a canopy-identity token for that one target, minted through the request’s outbound over the worker’s session (
auth::Outbound, acanopy_auth::WebOutbound), and minted once more after a receiver’s 401. A call whose bearer cannot be minted fails closed (auth_unavailable), and a handler can extract only the rosterserve_sessionbound to its request (the boot roster is layered asclients::SharedRoster, which only the serve reads), so nothing a handler sends goes without the worker’s identity. canopy-web’s own system token (WebSender::system_bearer) serves only work no request owns: the worker-directory sink and the worker-name refill. canopy-web boots only withCANOPY_WEBIDENTITY_CLIENT_PRIVATE_KEYandCANOPY_WEBUPSTREAM_CLIENT_SECRET(Configuration Reference › canopy-web). The session’s credential never leaves the BFF. - Outbound paths, redirects and links
-
Every upstream request path is an
UpstreamPath, and every formatted redirect target, like every href orhx-getURL built in Rust with a query value or a producer’s id, aLocalTarget(typed_path.rs, #2539): theupstream_path!/local_target!formats take only bare{}placeholders, checked at compile time, and every value goes in percent-encoded as one segment or one query value, so form or path text cannot add a segment, a query parameter or a header line. A local-target value must be typed (an id, a program, an integer, a date or a static slug), so an id read back from another service links only once it parses (a queue or palette row whose id does not is offered without a link, or not at all); free text read back from another service may stand in an upstream path asText, and an empty,.or..one refuses the call before it is sent. A search term or other free text rides a link only as an encoded query value. The one off-origin redirect, to the upstream’s authorization endpoint, is anIssuerTarget, which only the relying party’s authorization request constructs; the handoff page’s off-origin targets (a restarted flow’s authorization request, the upstream’s end-session endpoint) are URLs canopy-auth built, never request input. There is no general external redirect.cargo xtask web-paths auditkeeps redirects, upstream paths and URL query values from being formatted as text anywhere else. - Person-keyed writes
-
canopy-persons admits a worker’s delegation by role and knows nothing of the household a worker acts in, so binding a worker’s write to that household is canopy-web’s job (the #996 decision). Its one canopy-persons write client,
ScopedClients::persons, takes aPersonsWritePath(persons_write.rs, #2540), never anUpstreamPath: the person create (/v1/persons), a path beneath one household (/v1/households/{id}…), a path beneath one person (/v1/persons/{id}…), or the end of one pregnancy (/v1/pregnancies/{fact_id}, #3147). The person path is built only from aProvenPerson, whose one constructor finds the person among the household’s roster members (fact_editor::prove_household_memberreadsGET /v1/households/{id}, never the SSN-decrypting/fullbundle, #2680). The pregnancy end names no person, so it is built only from aProvenPregnancy, whose one constructor finds the fact among a proven person’s own pregnancies (PersonsWritePath::end_pregnancy). Each suffix joins beneath its base (UpstreamPath::join) or refuses the path before anything is sent. A per-target blessing of the canopy-persons client (into_authorized/into_neutral) is refused at every verb. So a person-keyed persons write that skips the membership proof does not compile. - Person reads
-
canopy-persons decrypts the SSN, and stages a Pub-1075
ssn.accessedevent for each person who has one, onGET /v1/persons/{id}, and on the person searchGET /v1/persons?search=and the household bundleGET /v1/households/{id}/fullonly when theirprojectionnamesperson_ssn(#2705, #2986). The Income, Assets and Expenses tabs read the bundle projecting only their own fact group, and the Address tab its addresses, pregnancies and homelessness periods (addresses,pregnancies,homelessness, #3147); the Persons tab, which shows each member’s last four and parents, projectsperson_ssnandparent_child(#3047). A read that needs only member ids, relationships, names, dates of birth or one person’s own facts takes none of them (#2680): the members come fromGET /v1/households/{id}(household_head::read_roster), names and dates of birth fromPOST /v1/persons:batchGetunder the empty projection (ServiceClients::person_cores,household_head::read_named_roster), a read retried and deadline-bounded like a GET (InternalClient::post_read), and one person’s facts fromGET /v1/persons/{id}/addressesandGET /v1/persons/{id}/income, which serve a soft-deleted person too, and fromPOST /v1/persons:batchGetfor that one person projectingpregnancies(include_inactive, #3147). The roster serves the membership proof of every person-keyed write (fact_editor::prove_household_member), the head of household the create-enrollment, create-certification and file-application actions resolve, and the file-appeal requestor check; the roster with names serves the change-history members, the file-appeal requestor picker, the Medicaid categories tab's cooperation and qualifying-activity section (#3191, #3205) and the SNAP ABAWD tab's work-registration section (#3218); the person core serves the case hero’s head name, the representatives' names, the process page’s and intake form’s applicant name, and the names and ages on the determination roster and the Medicaid categories tab; the proven person’s own facts serve the address editor’s redaction guard (addresses) and the pregnancy end’s ownership proof (pregnancies), and the person’s pending proposals serve the IEVS accept’s retry lookup (income/proposals?discrepancy_id=, #2546). The batch serves a soft-deleted person still on the roster too (include_inactive, #2705), so those views name them; only an id canopy-persons does not know falls back toPerson xxxxxxxx, "Unknown", "Unknown applicant" or a blank. The SSN-decrypting reads stay where the SSN’s last four is shown:GET /v1/persons/{id}on the Household tab, and the bundle projectingperson_ssnon the Persons tab. Case search and the ⌘K palette search under an emptyprojection, which opens no SSN (#2705). - Fact reads
-
The Income, Assets, Expenses and Persons tabs and the CAPS tab's parents-and-children section decode the household bundle as canopy-persons' contract type,
HouseholdFull, with itsMemberFull,Person,Income,Asset,ExpenseandParentChildRelation(#3377); canopy-web keeps no private copy of those shapes. The decode is strict: a fact or member canopy-web cannot read fails the whole read. The Income, Assets, Expenses and Persons tabs then show their error state with Retry, and the CAPS section its "couldn't load" line with the tabPartial. A fact or member is never left out of a list that otherwise renders: a worker who sees the list sees everything canopy-persons served. Two more reads follow the same rule. The Persons tab's membership ids come fromGET /v1/households/{id}decoded asHouseholdWithMembers, and a roster that does not parse hides every remove and relationship form behind the visible removal-unavailable note. The process page's gross-income preview decodesGET /v1/persons/{id}/incomeasIncome, and a member whose income does not parse makes the total "—", never a sum without that member. - Roster and search reads
-
Every other read of
GET /v1/households/{id}decodesHouseholdWithMembers, and both person searches (GET /v1/persons?search=) decodePerson, under the same strict rule (#3398); canopy-web keeps no private roster, household or search-hit shape, and a member's person id is aPersonIdfrom the decode on. A read that does not decode takes the path a failed fetch of that surface already takes. The shared roster read (household_head::read_roster) fails, so a membership proof before a fact, parent–child, TANF work-standard or appeal write refuses the write with that action's roster-unavailable answer, filing an application answers roster-unavailable, head-of-household resolution reports an upstream failure and never a headless household, and a member picker shows its roster-unavailable option. The Determination tab shows its household-roster error block, the Household tab its members error block and the degraded address card, the WIC Nutritional Risk tab its error block, and the case hero a "—" member count under an "Unknown" head. The process page shows no household size, applicant or income total. The case search shows its error fragment with Retry, and the command palette treats its persons leg as failed: the error arm, or the incomplete-list line over the notices that did load. - Appeal reads
-
The Appeals list (
GET /v1/appeals) and My Queue's appeals source (GET /v1/appeals/queue) decode canopy-appeals' contract type,AppealRequest, as the Pending Hearings panel and the case page's Appeals tab do (#3408); canopy-web reads no appeal field by an untyped key. The decode is strict, and an appeal that does not decode fails the read. The Appeals list then shows its error state, never a list with that appeal missing or a blank where its field was, and My Queue treats its appeals source as failed: its error arm, or the incomplete-list line over the items that did load. - Audit event reads
-
The dashboard's Audit Events panel and the case page's Activity tab decode canopy-security's
GET /v1/security/eventsas its contract type,AuditEvent, as the audit log and its citation do (#3408). The decode is strict, and an event that does not decode fails the read: the panel shows its error state with Retry and the Activity tab its "Couldn't load activity" block, never the remaining events alone or a row reading "unknown" where a field was missing. - Overdue case reads
-
The dashboard's Overdue Cases panel decodes canopy-renewals'
GET /v1/renewals/overdueas its contract type,OverdueCase(#3408). The decode is strict, and a case that does not decode fails the read: the panel shows its error state with Retry, never the remaining cases alone or a row with a blank where a field was missing. The supervisor KPIs' SLA-at-risk tile reads the same route only to count its rows, and decodes none of them. - IEVS hit reads
-
The dashboard's IEVS Alerts panel decodes canopy-verification's
GET /v1/verifications/ievs/discrepanciesas its contract type,IevsHit(#3408). The decode is strict, and a hit that does not decode fails the read: the panel shows its error state with Retry, never the remaining hits alone or a row with a blank where a field was missing. The supervisor KPIs' exceptions tile reads the same route only to count its rows, and decodes none of them. - Cross-program alert reads
-
The dashboard's Cross-program Alerts panel decodes canopy-eligibility's
GET /v1/eligibility/cross-program-alerts/alland…/scopedas their contract type,CrossProgramAlert(#3408). The decode is strict, and an alert that does not decode fails the read: the panel shows its error state with Retry, never the remaining alerts alone or a row with a default program or severity where a field was missing. - WIC reads
-
canopy-web decodes canopy-wic's answers as their contract types (#3408): the dashboard's Upcoming Appointments panel reads
GET /v1/wic/appointments/upcomingasWicAppointment, the case page's Nutritional Risk tab reads each member'sGET /v1/nutritional-risk-assessmentsasWicNutritionalRiskAssessment, and the nutritional-risk action decodes the same type from its create. The decodes are strict. An appointment that does not decode fails the panel's read, which shows its error state with Retry. An assessment that does not decode fails that member's read, which the tab marks as an incomplete list. Neither shows the remaining rows alone, or a row with a default where a field was missing. An appointment carries no location, so the panel names the WIC clinic on every row. - ABAWD tracking read
-
The SNAP ABAWD tab's tracking records are canopy-snap's
GET /v1/abawd/tracking, decoded as its contract type,AbawdTracking(#3408), and shown as JSON. The decode is strict, and a list with a window that does not decode is a failed read: the tab shows its "data unavailable" card, never the remaining windows alone. No windows is the "No data" card. Each record's fields print in the record's own order. The JSON is HTML-escaped before it is put in the page, so a record's text is shown as text and never rendered as markup (#3586). - Notice reads
-
Four surfaces decode canopy-notices'
GET /v1/noticesas its contract type,NoticePage(#3408): the Notices list page, the dashboard's Recent Notices panel, the case page's Notices tab and the command palette's notices leg. The decode is strict, and a page with a notice that does not decode fails the read: the list, the panel and the tab show their error state with Retry, and the palette counts its notices leg as failed, as for an outage. None shows the remaining notices alone or a row with a blank where a field was missing. Each link a row has, to the notice's case (the list page) or to its PDF (all four), is built from the ids the contract carries, so it is always present; a page carrying an id that is not one does not decode, and no link is built from it (#2539). - Application list reads (dashboard)
-
The dashboard's Recent Applications and Team Queue panels decode canopy-applications'
GET /v1/applicationsas its contract type,Application(#3408). The decode is strict, and a list with an application that does not decode fails the read: the panel shows its error state with Retry, never the remaining applications alone or a row with a default status where a field was missing. A row's process and case links are built from the ids the contract carries, so they are always present. Recent Applications shows the first program an application requests, and no program chip for one that requests none. The Team Queue page, the Applications list and My Queue decodeApplicationunder the same rule (#3584). My Queue, on the dashboard and on/cases, reads the route twice, for its in-flight and its post-lapse applications. A list with an application that does not decode fails that read: the queue shows its incomplete-list banner over the rows its other reads delivered, or its error state when none did, and never that list's remaining applications alone. - Application reads (case page)
-
The case page and its tab fragment read the household's newest application for the active program (
GET /v1/applications?household_id=&program=&limit=1) through one function,page::program_application, which decodes canopy-applications' contract type,Application(#3408). The page takes the application's id, whether ELE consent is still open (its status issubmittedorprocessing), and its renewal identity for the recertification chip; the tab fragment takes the id. A household with no application for the program, a failed read and a list that does not decode all read as no application: an empty application id, which the case templates test before they render an application-bound action. - Application read (process and intake pages)
-
The process page reads
GET /v1/applications/{id}as canopy-applications' contract type,ApplicationWithPrograms(#3408). The decode is strict: a row that does not decode, a missing or malformedprograms_requestedincluded, is a failed read, and the page shows its error state with nothing read after it. A row that decodes is authorized before anything of it is shown, any-of itsprograms_requestedin the worker's scope (authorize_application_programs): a list with no program, or with a program canopy does not know, authorizes no one and is refused 422; a list outside the worker's programs is refused 403. The intake page reads the same route the same way. A row that does not decode renders the page under its "Could not load this application" banner, and no household is read for it. A row that decodes is authorized by the same rule, and then tells the page whether its program is one the application requests and whether that program's row isdata_collected. - Application read (approve, deny, run determination)
-
The approve, SNAP deny and run-determination actions read the application they act on as
ApplicationWithProgramstoo, before any write (#3408). A row that does not decode is refused as a failed read: "Failed to fetch application" for approve and deny, "Could not load the application" for a run. Approve takes the household and the requested programs from the row and authorizes all-of them; an empty list or an unknown program is refused 422. The SNAP denial requires SNAP among the requested programs and takes the SNAP program row's status as its concurrency token. A run requires that the application request its program. The request-verification action reads the application the same way, confirms it belongs to the household, authorizes all-of its programs, and requests for the person who submitted it; cancelling a verification that carries no program reads it to authorize all-of its programs. In both, a row that does not decode is the action's own read failure ("Couldn't load the application for this household"; a 502 for the cancel). - Stored sections read (intake page)
-
The intake page reads the application's stored sections (
GET /v1/applications/{id}/sections) as canopy-applications' contract type,ApplicationSection(#3408). Each accordion row joins its section with the stored row for the page's program: a completed section reads "Saved", a draft "Draft saved" and the legal day it was last saved, and a section with no row "Not started". The decode is strict: a list with a section that does not decode fails the read, and the accordion shows its error block rather than rows that read "Not started". - Verification request write
-
Requesting a verification sends canopy-verification's
POST /v1/verifications/requestsits contract request,CreateVerificationRequestsRequest: one item of the requested type for the application's submitter, in checklist mode with no due date (#3408). The answer is read asVerificationRequestsResponse, and the item'screatedflag picks the landing notice: a new request, or an open one that already covered the need. An answer that cannot be read is not a failed write, since the request was recorded; it lands on "already open", which promises no letter. - Verification gate
-
The intake page and the run-determination action each read whether the application has a pending verification (
GET /v1/verifications?application_id=&status=pending&limit=1) and only count the rows. One row blocks the run: the page disables Run Determination, and the action refuses, naming the open verifications. A read that fails, or an answer that is not a list, blocks it too, and both say the status could not be confirmed rather than that open verifications exist (#1319 for the page, #3590 for the action). - Determine call
-
Approve and run determination send canopy-eligibility's
POST /v1/eligibility/determineits contract request,DetermineRequest: the application and household by their typed ids, the programs, the worker's name and, for a run, the worker's report date when the form carries one (#3408). The answer is read asDetermineResponse. An answer that does not decode is no response, not a failed run: the orchestrator accepted the call, but the answer names no determination to look for, so canopy-web reports the run pending (#3202). - SNAP parameters read (process page)
-
The SNAP process page reads canopy-snap's
GET /v1/params?household_size=as its contract type,SnapParamsResponse, and shows the gross and net income limits on its "Gross income limit" and "Net income limit" lines, as dollars rounded to the cent (#3588). The page names no percentage of the poverty level beside them (#3589): the limits are the jurisdiction's table values, and the page does not know what share of the poverty level they are. The limits are decimals, which are strings on the wire. A read that fails, or an answer that does not decode, shows a dash for both and raises the page's incomplete-data banner. - Determination reads (case hero)
-
The case page's identity hero decodes canopy-eligibility's newest determination per program (
GET /v1/eligibility/determinations?latest_per_program=true) as its contract type,ProgramDetermination(#3408). The decode is strict, and a list with a determination that does not decode fails the read: each chip whose status comes from this read then reads "Status unavailable", as for an eligibility outage, so no verdict from the read is shown beside a row of it the hero could not read. This includes a row whose status is not a verdict. What the hero already does for that outage is unchanged: the Medicaid chip still shows its household rollup when it has one, since that comes from canopy-medicaid's per-subject rows; an Express Lane grant does not stand in for a determination while the read is unavailable (#1306); and a program that is not deployed reads "Not configured". The process page reads the route's per-household list (?household_id=&limit=) asProgramDeterminationtoo, and shows the row for its application and its program (a Medicaid page takes a row stored underchip): its verdict in the worker's words with its basis, and its benefit in dollars. A list that does not decode, a status that is not a verdict included, leaves the verdict unavailable; no row for the application and program is "not yet determined". - Program determination lists
-
The dashboard's Recent Determinations panel reads each in-scope program's
GET /v1/determinations?limit=2as the type that service declares for its list (#3408): an array ofSnapDeterminationReadfrom canopy-snap, aTanfDeterminationPagefrom canopy-tanf, aMedicaidDeterminationPagefrom canopy-medicaid, an array ofCapsDeterminationReadfrom canopy-caps and an array ofWicDeterminationReadfrom canopy-wic. The decode is strict, and a list in another shape or with a row that does not decode fails that program's leg: the panel shows the program's "couldn't load" row, never the list's remaining rows alone. A row is dated bydetermined_at, or for CAPS and WIC, which stamp none, bycreated_at. Its case link is built from the household id the contract carries, so it is always present. A WIC income reassessment decides no one's certification and is not shown. The case page's?program=allmatrix reads SNAP's and TANF's lists for the household the same way: the row is the first listed determination's verdict and decision day, and a list that does not decode is the row's "Unavailable". The Medicaid COA Categories tab decodes canopy-medicaid's page for the household: its first determination names the application whose categories the tab shows, and a page that does not decode is the tab's error block, never its "No COA evaluation results". - Resource-keyed writes
-
A worker’s form names a resource by id and the receiving service acts on it by id, so canopy-web binds the resource to the household the worker acts in before the write (#2543). The household resources it writes by an id taken from the request — IEVS and TANF discrepancies, CAPS authorizations, recert nudges, SNAP appeals, adverse actions, authorized-representative designations and representative disqualifications — stand in a write path only as a
Boundid (bound_resource.rs): their id types are not path segments, nor is a rawUuid(so an id’s raw value is none either), and aBoundid is minted only by a read that found the resource on the household (the household canopy-snap matched the IEVS discrepancy for, the TANF discrepancy’s, appeal’s, action’s or designation’s own household, the authorization’s determination, the household’s nudge list, the disqualification’s noticed households), else the action’s refusal and nothing written. ABoundid also carries the household its read proved (Bound::household_id, #2545), and a write body names that household, never a form field. A receiving service that checks it refuses a resource of another household before it writes: canopy-tanf’s discrepancy resolve (409discrepancy_household_mismatch, canopy-tanf API), canopy-snap’s IEVS discrepancy resolve (409discrepancy_household_mismatch, #3103, canopy-snap API), canopy-caps' authorization update and provider switch (409authorization_household_mismatch, canopy-caps API), canopy-renewals' nudge action (409nudge_household_mismatch, canopy-renewals API), canopy-enrollment’s adverse-action cancel (409adverse_action_household_mismatch, #3105, canopy-enrollment API), canopy-wic’s termination cancel (409termination_household_mismatch, #3107, canopy-wic API) and canopy-applications' section upsert (409section_household_mismatch, canopy-applications API). The other receiving services act by id alone.cargo xtask web-paths auditrefuses, inside a path or aText, a value stringified there, a posted form field, and an id unwrapped there (.0,into_inner,as_uuid,Uuid::from). What neither holds: the program-service write clients take anyUpstreamPath(no write-path type accepts onlyBoundsegments, asPersonsWritePathdoes for canopy-persons), and the audit reads only the expression in the path, so a string or raw value built in an earlier statement, or an untypedStringpath parameter inText, passes. Other request-id writes bind by their own reads: the section save holds a posted household and every person it names to the application’s household, the ELE consent binds its application to the posted household, the document reviews refuse an application of another household than the one posted, the Medicaid CMD event refuses an application of another household or one not requesting Medicaid, and a verification cancel finds the verification on its application’s list. The ELE consent’s receiving service checks too: the body names the household the binding read proved, and canopy-applications refuses an application of another household (409application_household_mismatch, #2545, canopy-applications API).
Authorization model
| Surface | Authority | Denial | Marker |
|---|---|---|---|
Every route in |
|
redirect to |
— |
Every mutating route (POST / PUT / PATCH / DELETE) |
A mutating route in any other file, or one whose handler is an inline closure, fails the audit. A test in |
403 before any upstream call: the wrong role for |
— |
Program scope on writes (ADR-044, #1516) |
|
403 out of scope; 422 no usable participation set (fail-closed) — both before the upstream call |
|
Protected reads (ADR-044, #1518) |
|
403; an empty participation union on the full case page is an honest 404; an unparseable union is 422 |
|
Role gates |
|
403 with zero upstream I/O |
|
Composition JSON ( |
|
401 without a session; 503 |
— |
Pages and fragments
Protected GETs mounted in api::routes(). "Scoped read" is the READ_SCOPE_POLICY mechanism.
| Route | Read gate | Purpose → upstream |
|---|---|---|
|
hero |
Composition-driven dashboard; surface by |
|
same panel fetchers |
Single-panel htmx refresh (the error-block Retry); 404 when the slug is outside the caller’s composed surface, deliberately indistinguishable from "no such panel" so the endpoint cannot probe another role’s panels (an |
|
not program-scoped (own layout) |
Customize My Dashboard (ADR-024): hide / reorder / resize within the role baseline; saves via |
|
scoped queue + search helpers |
Case search page; the same My Queue above the search shell, its rows carrying the panel’s |
|
per-row participation gate |
htmx result rows (300 ms / 2+ characters); the fragment degrades on an outage, never "not found". A row's program label and its in-scope decision come from the household's participation union, the one read ( |
|
per-row |
⌘K palette fragment; empty |
|
the composition’s roles, then participation any-of |
The household id is a typed path id: a malformed one is 400 before any upstream call, as on the tab and fact-history routes (#2539). Case detail: the jurisdiction’s composed |
|
same (fragment) |
One tab: 14 explicit arms plus the composed-section fall-through; an unknown slug renders the not-in-composition placeholder. The |
|
the composition’s roles, then participation any-of |
Change history for |
|
same + person→household binding (403) |
SNAP rep-disqualification timeline: canopy-applications |
|
participation any-of + SNAP view gate + mintable-role bar + #408 assignment mirror |
Benefit-continuation panel: |
|
|
Application list (50 newest); |
|
|
Processing page, program-parameterised — see Process page contract. |
|
the process page's gates for its SNAP panels, in its order: SNAP view gate (before any read), then |
The reopen panel as a fragment (#3396, |
|
same |
The postponement panel as a fragment (#3396), for |
|
path-program gate + application read |
Per-program intake page ( |
|
|
Notice history (canopy-notices). |
|
|
Appeal queue (canopy-appeals). |
|
per-program legs |
Renewal queue, 30 / 60 / 90-day windows. |
|
same |
Renewal table body fragment. |
|
|
Every |
|
upstream |
System audit stream from canopy-security; filters |
|
same |
CSV of the displayed view (same list URL). |
|
row-programs authorization; same roles |
Signed "Cite for hearing" PDF via canopy-notices |
|
not program-scoped; Supervisor / Admin |
Day-30 disposition report from canopy-applications |
|
not program-scoped; Supervisor / Admin |
The manual applications-drain trigger page, in the worker layout ( |
|
|
The worklist of open interactive envelopes canopy-eligibility quarantined (Quarantined-envelope worklist (#2061)) — canopy-eligibility |
|
|
One program’s held determinations, each with its disposition (Held-determination worklist (#3127)) — canopy-eligibility |
|
authorized by the owning case |
Notice PDF stream (canopy-notices). |
|
application read on the owning application |
Document bytes from canopy-applications on the worker’s delegation, served |
|
per-connection fail-closed program filter |
Server-Sent Events: the determination registry plus |
Dashboard panels — the analyst pipeline funnel (dashboard/panels/analyst_pipeline_funnel.rs, STAGES): one GET /v1/applications fetch per stage, each limit=200 (200+ at the cap) and programs=-scoped to the session; a failed fetch renders — in its own column and every fetch failing renders the panel error state. Submitted, Screening and Determination count the parent applications.status (statuses=submitted / processing / determined — the tokens recompute_application_status and the column default write). Verification and Authorized count applications with an active application_programs row in data_collected / approved (program_statuses=, #2169), because no write produces either token on the parent row (State Machines › Application Status). The stages are not disjoint: an application approved for SNAP while its TANF row is still pending is counted in both Screening and Authorized.
Process page contract
GET /applications/{id}/process renders from RECORDS, never from re-derived clocks, and marks the page incomplete rather than failing when a leg fails:
-
Program view (
?program=<slug>): resolved exactly as on the case tabs — an explicit out-of-scope slug is 403 and an unknown slug 422 (the sharedScopeDenied::view_gate, before any read); absence falls back to the worker’s first in-scope program, never a hardcoded SNAP;chipfolds into Medicaid. The SNAP view is byte-identical to the pre-parameterised page (pinned by thetestdata/process_snap_*.htmlgoldens). A Medicaid/CHIP view renders the program-neutral core — the program-labelled title, the summary with that program’sdata-program-clockcell, the verification work items and the program’s OWN determination row from the per-household eligibility read — and none of the 7 CFR 273.2 SNAP blocks below (disposition / reopen / postponement / post-lapse / expedited, the interview panel, the 130 % / 100 % FPL income test, the SOP cell and recertification chip, the Approve / Deny pair); it offers the case page’s program tab (data-case-link,/cases/{household_id}?program=<slug>) where the SNAP actions were, and reads none of the SNAP legs. -
Disposition banners (
api/disposition_banner.rs,role="status", text-labelled): PENDED fromGET /v1/applications/{id}/agency-pends(cause as a closed-token label, the extended deadline, a pend history); DENIED (administrative) fromGET /v1/administrative-denials/{id}(reason label, cure action, the snapshottedreopen_deadline_date; a recertification row points at the reinstatement panel instead); EXPEDITED WINDOW MISSED fromexpedited_downgraded_at. A failed read renders no banner and marks the page incomplete. -
Reopen panel
#reopen-panel(api/reopen_panel.rs): history fromGET /v1/applications/{id}/programs/snap/reopen/episodeson every active SNAP row; the server previewGET …/reopen/eligibilityonly on an administratively denied row. Cures are confirm dialogs posting onlycure_kind(+attestation_id) and the page’s per-render key (#2708); blocked reasons render as text; a recertification preview renders the 7 CFR 273.14(e)(2) variant. Hooks:data-reopen-incomplete,data-reopen-attest,data-reopen-notice,data-reopen-file-application. -
Live refresh of the two panels (#3396): each renders inline on first load inside a slot that is present on every SNAP view, panel or not —
#reopen-panel-slot(hx-get/applications/{id}/snap/reopen/panel,hx-triggersse:application_reopened from:body) and#postponement-panel-slot(hx-get/applications/{id}/snap/postponement/panel, triggered by the three postponement events), bothhx-swap="innerHTML". The page and the fragment include one partial each (templates/applications/_reopen_panel.html,_postponement_panel.html). A refetch replaces the panel, so input typed into one of its forms is lost; the?notice=banners sit outside the slots and stay. -
Postponement panel
#postponement-panel(api/postponement_panel.rs) fromGET /v1/applications/{id}/programs/snap/postponement: the three gates (data-postponement-gate,data-gate-satisfied,data-identity-holder), the postpone trigger (data-postpone-trigger, offered only whenpostponable), items, history, thedata-postponement-incompletesaga banner with Resume, the supervisor revert form. -
Post-lapse banner
data-post-lapse-banneriff theGET /v1/applications/{id}read sayspost_lapse_pending, with the letter-evidence line (data-post-lapse-letter) and the released clockDetermination due <day>(data-post-lapse-due,data-overdue). -
Interview panel
#interview-panel: kind-branched date hints; refusals land inline through the PRG?interview_error=<code>&interview_error_detail=…#interview-panel(a closed nine-token vocabulary,api/actions_interview/copy.rs); thedata-interview-completeform renders only while an appointment is open andinterview_completed_atis unset. The schedule / reschedule form is collapsed by default and has two openers: a relayed refusal (which must show the inputs it complains about) and?schedule_interview=true(#580) — the flag the case page’s Action ▾ Schedule Interview… entry deep-links with, resolved server-side into the panel’s Alpine state so the CSP build evaluates nolocation.hash. -
Recertification chip (
data-recertification-chip):Recertification of <start>–<end>from the one renewals read, degrading toRecertification — period ends <end>; the SOP label is chosen by kind from the row’s own facts. -
?notice=<slug>banners are server-allowlisted (reopened,reopen-resumed,reopen-attested,postponed,postponement-completed,postponement-reverted,postponement-resumed,interview-scheduled,interview-rescheduled,interview-completed,interview-scheduled-headroom-short,verification-cancelled).
SSR deadlines & degraded states
Twenty-three read routes — thirteen under the page budget, ten under the fragment budget — run under an aggregate request deadline (#1306 built the machinery, #1319 extended it to the remaining SSR read surfaces; SSR aggregate request deadline): every upstream read a handler makes — gate wait, retries, token acquisition, body and decode — is bounded by one absolute cutoff, and an upstream failure renders an honest per-component state instead of a whole-page 500. The coverage is the set of handlers that construct RequestDeadline::from_now(Duration::from_millis(web_config.{page,fragment}_deadline_ms)) — 22 sites under services/canopy-web/src/api/, one per route below except the two process-panel fragments, which share one; no other route constructs either budget.
| Budget | Default | Knob | Applies to |
|---|---|---|---|
Page |
12 000 ms |
|
13 routes: |
Fragment |
8 000 ms |
|
10 routes: |
Session serve |
the page budget |
|
every request behind |
Service calls |
30 s constant ( |
— |
how long a request’s calls may mint delegations, from its start: past the page budget, so a write that outlasts the page still has its bearers |
Boot validation bounds the knobs (page ∈ [1 000, 14 000] ms, fragment ∈ [1 000, 9 000] ms); CANOPY_WEB__DEADLINE_OVERRIDE=true is the accountable override (loud warn every boot, hard 600 s cap). Per-component caps come from each plugin manifest’s data.timeout_ms (default 5 000 ms); the binding constraint is min(page deadline, component cap). Knob semantics: Configuration Reference › canopy-web.
One token-failure rule. A call whose bearer cannot be minted fails with a typed auth_unavailable before any request is built, on every verb and in every handler, with or without a deadline (ServiceClient::bearer, clients.rs). No handler sends a request without a bearer.
Declined: a middleware that stamps the deadline (#1324). Each handler constructs its own deadline, and a from_fn layer that minted one for every GET was considered and turned down:
-
The budget is per route. One file serves a page under the page budget and its fragment under the fragment budget (
api/dashboard.rs), so the layer would need a second route table to choose, and another to exempt downloads and writes. That table would restate a judgment each handler already makes. -
The layer would remove only the mint. Each handler would still read the deadline to bind its clients and to record
canopy_web.page.outcomeonce at its exit. -
Writes take no page deadline: a write is never cancelled part-way (#1320 owns bounded writes).
Nothing mechanical detects a new read route that lands without a deadline. The per-route hang tests cover only the routes already listed above, so a new read route constructs its deadline and adds its hang test in its own MR, and review checks for both. Revisit this when #1320 needs a bounded write in a stamped handler, or when a read route first lands without a deadline.
Every covered component renders exactly one of populated, empty (the upstream answered and there is genuinely nothing — an outage is never "All caught up"), degraded (some legs failed; rows stay visible under an incomplete-list banner with a per-component Retry) or error (a static block with Retry; copy is time-aware and never quotes upstream text, #715).
Telemetry
SSR-deadline, panel-cache, session-refresh, session-store and sign-out instruments on the canopy_web meter (label values are closed enum names, compile-time slugs or configured chooser-entry slugs; upstream text never crosses into metrics). The meter also carries canopy_web.auth.admission_rejected, canopy_web.session.decode_failed and canopy_web.authz.scope_denied (telemetry.rs).
| Instrument | Labels | Recorded |
|---|---|---|
|
|
once per logical upstream call |
|
|
once per rendered component, at its own fetch seam; the count is the render count |
|
|
once per handler exit on 17 of the 23 deadline-covered routes — the two audit-log downloads record no page point (downloads sit outside the page/fragment vocabulary) and the continuations and representative-history fragments record component points only, under |
|
|
one disposition per cache consultation; bypass once per scoping event whose TTL is 0 |
|
|
evictions under the |
|
|
once per session canopy-web refused to admit: at the callback (sign-ins project to no worker) or a later serve (re-federation stopped projecting one) |
|
none |
once per session row whose record no longer decodes, which reads as no session |
|
none |
once per request whose idle-deadline slide failed; the request is still served |
|
|
once per failed step of a session sweep pass; serving is unaffected and the next pass retries |
The panel-data cache (#1218) sits at the InternalClient JSON-GET seam: fail-closed guards run before any cache read; entries are keyed (service, full URL, sha256(credential)); hits are judged against the calling panel’s resolved TTL (0 bypasses; the authorization-filtered panels, cross-program alerts (#596) and pending verifications (#2336), always resolve 0 whatever the manifest or composition sets, AUTH_FILTERED_PANEL_SLUGS); per-key single-flight coalesces cold bursts; only successfully decoded 2xx bodies are cached.
Composition JSON API
The composition sub-router (api::composition::routes(), merged in main.rs outside the CSRF / require_auth layers) exposes the three DB-backed override layers of ADR-022.
| Route | Gate | Behaviour |
|---|---|---|
|
|
Jurisdiction-live layer: GET reads, PUT replaces, PATCH applies RFC 6902 ops ( |
|
|
Explicit-archive the live override after a Studio promote-merge. |
|
|
Role override layer (filtering applies after the merge, ADR-021); 404 |
|
|
Per-worker layer, keyed by the session’s OIDC subject byte for byte ( |
user_delta_v1 (ADR-024): {"type": "user_delta_v1", "hidden_slugs": […], "span_overrides": {slug: span}, "slug_order": […]} for worker_dashboard / supervisor_dashboard / analyst_dashboard; every slug must exist in the post-role-filter baseline (SlugNotInBaseline → 422) and every span must be in the manifest’s allowed_spans (SpanOutOfRange → 422). Writes take the If-Match / If-None-Match: * precondition headers (412 / 428).
Every composition surface load emits the best-effort telemetry event composition.render (payload {jurisdiction, role, user_id, surface, version}, ids and slugs only; user_id is the worker’s OIDC subject, present for every worker load since #1008 and absent for a role-level load; version is a 16-hex-character string — the first 8 bytes of the SHA-256 over the resolved document — never a JSON number, #1777).
Action endpoints
Every action rides the protected router’s session + CSRF layers and WritePermission; the Scope column is the SCOPE_POLICY classification — a ProgramScope<P> extractor, or resource (an AuthorizedResource proof from the household or application). Refusal copy is server-owned, keyed on the upstream’s RFC 9457 code; the upstream body never reaches the DOM (ADR-041). Success is a PRG redirect back to the case or process page unless stated.
A program action’s case redirect names the program it acted on: /cases/{household_id}?program=<slug>&focus_section=<section>, with the posted target_section narrowed by safe_focus_section (actions::program_case_landing, #3017). Without program= the case page opens the worker’s first in-scope program, so a worker holding several programs would land on another program’s view. The document review actions (POST /actions/documents/{accept,reject,scan-override}) have no program of their own: the Documents section is in every program’s view, and the review is authorized against all of the application’s programs. Each form posts the view it renders in as active_program, and the review lands on that program’s view when Program::from_slug accepts the slug and the worker’s scope holds it (actions::document_review_target, #3040). An absent, unknown or out-of-scope value lands without program=, on the worker’s default view.
Application lifecycle and intake proxies
| Route | Scope | Behaviour → upstream |
|---|---|---|
|
resource |
Approve → canopy-eligibility. The application id is a typed path id (a malformed one is 400), and the landing redirect is built from the row’s household id, parsed before any write (#2539). The determine call runs under |
|
resource (the SNAP row) |
Per-program administrative denial, reason ∈ |
|
|
Reopen a procedurally denied SNAP row (7 CFR 273.2(h)(2)) → |
|
|
Resume an |
|
|
Supervisor’s attestation of a cure day ( |
|
|
Open the expedited postponed-verification episode (7 CFR 273.2(i)(4)) → |
|
|
Evidence-derived completion → |
|
|
Reversion with one of the three manual grounds ( |
|
|
Resume an |
|
|
Record or move the interview appointment (#1638) → canopy-applications, the worker’s delegation; the date + time pair is combined in the legal zone. A refusal returns inline via |
|
|
Record an On-Demand call-in (#1734) → |
|
resource (the row’s own program; legacy program-NULL rows all-of the application’s programs) |
Cancel one verification work item (#1645) → canopy-verification. |
|
resource |
Per-program Run Determination → canopy-eligibility; |
|
resource (SNAP or TANF) |
Worker-attested ELE consent (#977) → |
|
resource |
Intake section save: |
|
resource |
→ |
Case actions
| Route | Scope | Behaviour → upstream |
|---|---|---|
|
resource |
Written-request batch ( |
|
resource (per program, fail-closed) |
File a new application for the existing household (#978) → |
|
resource (all-of the posted program set) + household case access |
Designate an authorized representative (#1666) → |
|
|
Bar the representative from SNAP representation (7 CFR 273.2(n)(4)) → |
|
|
Reverse an open bar → |
Refusals on the Representatives section swap into its role="status" aria-live="polite" region at their honest status (data-swap-errors); both modals run under the shared CanopyFocusTrap in canopy-web.js (the focus trap and client-side validators are syntax-checked only — no browser test covers them).
SNAP renew election (#1728)
The "File application" modal (api/actions_intake.rs + its renew / copy children; view model case_detail/renew_election.rs) files a SNAP recertification against the household’s certification, resolved server-side from the one renewals read the case page already performs (GET /v1/renewals/snap/certifications?household_id=): an active certification offers the renew_snap checkbox; a recertifying one renders the "Open the existing renewal" link instead (data-renew-election="existing"; a 404 on the linked application means it was withdrawn — data-renew-election="withdrawn", no control); no in-force certification or a read failure offers no control. On submit a ticked box with programs ≠ ["snap"] is refused locally; otherwise the handler re-reads the certification and POSTs CreateApplicationRequest { renews_certification_id, programs_requested: ["snap"], … } on the worker’s delegation. Refusals render the shared _action_error.html fragment (HTTP 200) with the copy table in actions_intake/copy.rs, keyed (status, code, detail):
| Refusal | Copy (first sentence) |
|---|---|
409 |
A SNAP renewal is already filed for this certification — open the existing renewal. |
409 |
This household already has an open |
422 |
The certification to renew does not belong to this household — file as a new application. |
422 |
This household has no in-force SNAP certification to renew. |
422 |
The SNAP certification has already ended — a late re-application is not a renewal. |
422 |
It is too early to renew: the window opens on |
422 |
Not filed as a renewal: the postponed verification is still being resolved. |
422 |
A renewal renews the SNAP certification alone — select only SNAP, or clear the renew box. |
422 |
A renewal cannot be expedited-screened. |
502 |
The certification could not be read from canopy-renewals — nothing was filed; retry. |
An unrecognised triple falls through to the generic upstream arm. The identity hero’s data-recertification-chip renders Recertification of <start>–<end> when the same read handed back the renewed certification, else Recertification — period ends <end>.
Generic and SNAP caseworker actions
Where a row below says a form id is parsed before any upstream call, it is parsed as its typed canopy_types::id before any upstream call or bearer mint (actions::parse_household_id, actions::parse_certification_id, and actions::parse_form_id for the others; #2380, #2385), so no upstream path, query or Location is built from the form’s text. A value that is not one is the inline Invalid … id. fragment, and the case redirect is built from the typed household id (actions::case_target, or actions::case_notice_target when a banner rides it).
The case-detail fact editors (income, assets, expenses, addresses and members) parse the form’s household id before any upstream call or token fetch, and the program tab, the fact ids their write paths name and the fact id an edit’s correction, or the IEVS accept’s matched self-report, carries in its claim body (#2709) after the scope and membership gates and before the write (fact_editor::{parse_household, parse_program, parse_fact_id}, #2539), so an out-of-scope worker still gets the gate’s 403. A value that is not one is the editors' 422 fragment, and the success redirect is built from the typed household and program (fact_editor::redirect_to_case); their person-keyed writes use the person id the membership check proved. The IEVS accept and reject actions, whose scope gate is the ProgramScope<Snap> extractor, parse the household, discrepancy and program the same way before any upstream call and redirect the same way. Both then bind the discrepancy to the posted household before any write (#2540): they read it from canopy-snap (GET /v1/verification/discrepancies/{id}), and the household canopy-snap matched it for (its match result’s, served with the discrepancy, so the binding holds whatever has become of the application since, #2543) must be that household, or the action is the 403 That discrepancy does not belong to this household. The accept form carries no person id: the income claim is keyed on the discrepancy’s own subject, proven a member of the household (the editors' not-a-member 403 otherwise), so the persons write and the snap flip happen only after both checks. The accept holds its income as a canopy-persons proposal (POST /v1/persons/{id}/income/proposals, #2546), which feeds no determination until canopy-persons consumes canopy-snap’s resolution event and promotes it (ADR-027 Amendment 6). So no race can leave unlinked income feeding eligibility.
-
Choosing the fact. Under canopy-snap’s resolve guard (#2544) the accept decides its fact before writing:
-
An open discrepancy proposes a correction of the form’s matched self-report.
-
Otherwise it proposes onto the fact a pending proposal of the discrepancy already names (a flip-failed earlier attempt, read from the person’s pending proposals).
-
Otherwise it proposes a new fact.
-
-
A repeat writes nothing. A repeat on a discrepancy already accepted with its fact (a double submit, a stale tab) writes nothing and lands on the case. A discrepancy resolved any other way when the accept reads it is refused (409) before the proposal.
-
A late resolution leaves the proposal inert. A resolution that lands between that read and the flip (another action’s, or a verification re-run’s withdrawal) is caught by the guard after the proposal is written. The proposal stays inert, and the accept answers 409 saying the income was not applied, with the reason the guard’s code names: another action resolved it, or a re-run withdrew it.
-
The landing. A successful accept lands with the
ievs-acceptednotice: the income applies once the resolution is processed. The Income tab shows an accepted discrepancy whose linked fact is not yet served as an IEVS-sourced income as "Verified — being recorded", on its paired self-report or as a row of its own. -
Double submits. The twins of a double submit of one rendered form can both read the discrepancy open before either writes. So the form carries a key minted once per render (
idempotency_key, required; a value that is not a UUID is the 422 fragment before any write). The proposal rides it as the platformIdempotency-Keywith the proposal body folded in (a UUIDv5 named by the body under the render key,ievs::claim_key, #2660):-
The twins propose one fact. A twin whose body matches the first’s gets that proposal’s fact replayed; one whose read landed after the first proposal finds it pending and proposes onto its fact under its own key.
-
canopy-snap answers each flip of that fact as the same resolution, and every twin lands on the case.
-
canopy-persons scopes the key to the acting worker the delegation names (#1443), so two workers' proposals never share one.
-
A submit of the same render whose body differs is its own proposal under its own key. An accept from another render is a write of its own that the guard still refuses as above, its proposal left inert.
-
The add forms of the fact editors — income, assets, expenses, addresses (POST /actions/{income,asset,expense,address}/add) add member (POST /actions/member/add), add parent (POST /actions/parent/add, #3047) and record pregnancy and homelessness (POST /actions/{pregnancy,homelessness}/add, #3147) — converge a double submit the same way (#2674). Each form carries a key minted once per render of its tab (idempotency_key, required; a form without one is axum’s 422 and one that is not a UUID the editors' 422 fragment, both before any write), and every canopy-persons create the add makes rides the platform Idempotency-Key derived from it with the exact request body folded in (a UUIDv5 named by the body under the render key, fact_editor::add_submission_key; the person create folds in the household and the worker beside its body, which names neither). The twins of a double submit post one body under one render key, so canopy-persons answers the second create with the first one’s stored response: one fact, or for add member one person — the person create and the membership claim derive separate keys, and the twin’s claim names the person its replayed create returned, so it replays the first membership too. A resubmit of the same render after the membership claim failed reuses the person that attempt created rather than orphaning another; a transient claim failure (one the middleware does not store — a 5xx, 408 or 429 past its cooldown, a 401 or 403, a transport error) then attaches it, while a refusal it stores (a 400, 404, 409 or 422) is answered again. The same add from another render (the next visit, a reload) is an add of its own under its own key. The middleware keys an entry by its path as well, so one render’s key serves every member’s add form; a twin that arrives while the first create is still running past the middleware’s wait budget gets its retryable 503 error page. The edit and remove forms carry no key: an edit’s correction and a remove’s close each name the fact they act on, so neither can write a second fact.
A fact write these actions refuse with a 403 is recorded in the audit trail (#3426). The refusal stages one fact_write.refused event in canopy-web's outbox, in a transaction of its own, before the 403 is answered; canopy-security records it as (refuse, fact_write) on the household, attributed to the worker. The payload is five fields and no fact value: actor_user_id (the worker's session subject), actor_role, household_id, editor and refusal. The event is program-neutral. refusal is one of:
-
not_a_household_member: the person or membership fact the form names is not on the household's roster; -
fact_not_the_members: the pregnancy or parent fact is not a fact of the member the form names; -
fact_not_the_households: the homelessness period or IEVS discrepancy belongs to another household; -
sealed_fact: the address or pregnancy is sealed (ADR-036); -
withheld_address: the household's addresses are withheld; -
program_out_of_scope: no program the household participates in is in the worker's scope.
editor names the action: income, asset, expense, address, household_member, parent, pregnancy, homelessness, ievs_discrepancy, and the program actions that share the roster binding, abawd_activity, abawd_eligibility, snap_work_registration, snap_work_sanction, tanf_work_activity, medicaid_cmd_update, medicaid_cooperation, medicaid_demonstration_activity, wic_nutritional_risk, wic_breastfeeding, caps_parent_activity and caps_care_need, and the actions that refuse a posted record of another household, or a person off the roster, on their own (#3434): recert_nudge (file and dismiss), document_review (accept, reject and scan override), verification_request, ele_consent, representative_disqualification (disqualify and reverse), tanf_discrepancy, tanf_work_standard, caps_authorization (update and provider switch) and wic_termination (schedule and cancel). The Medicaid CMD update records an application of another household under medicaid_cmd_update. A record of another household is fact_not_the_households; the work-standard basis action's person off the roster, or a person value that is not a person id, is not_a_household_member. One function (fact_editor::refusal::FactWrite::refuse) stages the event and builds the 403, and those 403 bodies are private to its module. An action whose 403 is a fragment of its own (the work-standard result, the representative actions' refusal, the verification request's error page) stages the same event through FactWrite::record_refusal and renders its fragment only once the event is staged. Only a refusal made through that module is recorded (the six refusal kinds above). Not recorded: role, case-access and program-scope denials, whether an extractor makes them before a handler runs (WritePermission, ProgramScope<P>) or a handler does (the representative actions' supervisor and case-access checks, the document review's and verification request's program checks); and a work-standard post whose household value is not a household id, which names no household to record it on. A read that refuses to render is not a refused write and is not recorded. Four actions answer an HTTP 200 that deliberately reads the same for another household's record as for a missing one, so a forged form learns nothing: the SNAP hearing decision (snap_appeal_decision), the adverse-action cancel (snap_adverse_action_cancel), the appeal filing's selected action (snap_appeal_filing) and the intake section save (intake_section). Their answer is unchanged, and the attempt is recorded when the record is another household's (the section save also records a person off the roster); a missing or unreadable record is not recorded (#3436). The appeal filing makes one more read, on the refused path only, to tell the two apart. When the event cannot be staged the write is still refused, the failure is logged at ERROR, and the answer is a 500 that names no reason. A 422 (a form value that does not parse, a read that failed) is not a refusal and is not recorded.
The process page’s reopen, postpone and administrative-denial forms (POST /applications/{id}/snap/{reopen,postpone,deny}) converge a double submit through canopy-applications' body-carried replay anchor (#2708). The page mints one key per render, and each of the three forms carries it (idempotency_key). A form without one, or with a value that is not a UUID, is refused before any upstream call (the action’s refusal page, or the deny action’s error fragment). Postpone and deny send the render key as their idempotency_key. Postpone’s body names nothing else, and canopy-applications replays a denial’s key only with the same reason, refusing another reason under it (409 idempotency_key_reused). Reopen sends the render key with the cure, and the attestation it rests on, folded in (a UUIDv5, actions_reopen::reopen_key). canopy-applications replays a known reopen key whatever the body, so a second cure posted from the same render must carry a key of its own: it then meets the open-episode 409 instead of a replay of a reopen it did not ask for. The twins of a double submit post one render’s anchor, so canopy-applications replays the first write for the second and both land as the success redirect. The same action from another render (a reload after the first landed) is a write of its own, which meets canopy-applications' state guard as a 409 (while the first write stands, reopen_episode_open, postponement_open or already_administratively_denied). The three writes are separate upstream records, so one render key serves all three forms.
| Route | Scope | Behaviour → upstream |
|---|---|---|
|
|
Posted from the case top bar’s Record Interim Contact modal, which carries the in-force certification hidden; the Determination tab offers no SNAP report form, so no worker types a certification id (#1620, #2386) → canopy-renewals |
|
|
canopy-renewals |
|
|
canopy-renewals |
|
|
The same nudge-action endpoint with |
|
|
Record ABAWD work activity → canopy-snap |
|
|
Resolve an IEVS income discrepancy → canopy-snap |
|
resource |
Author a worker income claim / |
|
resource |
Asset and expense fact editors (#676); no asset remove yet. The expense and asset adds and edits send the typed |
|
resource + household-membership binding |
Address claims ( |
|
resource + household-membership binding |
The Address section’s pregnancy actions (#3147,
|
|
resource |
The Address section’s household homelessness actions (#3147,
|
|
resource + membership binding (#1523) |
Member and demographics editors: create-and-attach, relationship correction on |
|
resource + membership binding (#1523) |
The Persons tab’s parent editor (#3047,
|
|
|
Accept holds the worker-verified income as a canopy-persons proposal on the discrepancy’s subject (canopy-persons fixes |
|
resource |
Document review → canopy-applications; accept also resolves any pending verification the document was submitted against ( |
|
resource |
Release a quarantined- |
|
|
canopy-renewals |
|
|
Replay the frozen snapshot against corrected facts (#681); |
|
|
canopy-enrollment: open an enrollment for the current approved determination (filing date = the legal filing day, #1583); issue one benefit month against the latest active enrollment. |
|
|
canopy-appeals: file a fair-hearing appeal, optionally bound to one of the household’s open adverse actions (validated against its own set); filing date server-stamped. |
|
|
canopy-appeals |
|
|
canopy-enrollment |
|
|
canopy-snap |
|
|
canopy-snap |
|
|
canopy-snap |
Program-specific actions (#392)
All four ProgramScope<P> for their program. The interim-contact and change-report actions are household-level (#2409): canopy-renewals keeps no certification for these programs, so each program’s form is one form per action naming the case’s household and no certification, and the action posts to the program’s canopy_contracts_renewals::paths::PROGRAM_INTERIM_CONTACT / PROGRAM_CHANGE_REPORT (actions::program_report_path) with the typed ProgramInterimContactRequest / ProgramChangeReportRequest, whose household_id is the case’s (#2369, #2379). A form household_id that is not a household id is refused before any upstream call (Medicaid at 422, #1976), and the case redirect follows renewals' recorded row.
| Route | Behaviour → upstream |
|---|---|
|
canopy-renewals |
|
canopy-tanf |
|
canopy-tanf |
|
canopy-renewals |
|
canopy-persons |
|
canopy-renewals |
|
canopy-caps |
|
canopy-caps |
|
canopy-caps |
|
canopy-caps |
|
canopy-caps |
|
canopy-medicaid |
|
canopy-medicaid |
|
canopy-renewals |
|
canopy-wic |
|
canopy-wic |
|
canopy-wic |
|
canopy-wic |
|
canopy-wic |
Ops and Studio
| Route | Scope | Behaviour → upstream |
|---|---|---|
|
not program-scoped; Supervisor / Admin |
Manual applications-drain trigger (#1642) → |
|
|
Re-verify or dismiss one quarantined envelope → canopy-eligibility |
|
|
Adopt the re-read hold’s operation → canopy-eligibility |
|
|
Drop the re-read hold’s events → canopy-eligibility |
|
|
Advance the composition onboarding wizard (session-stored |
|
|
Cancel the wizard and clear the draft. On Steps 1 to 3 the Cancel button sits in the step’s actions row but submits a separate form after the step form ( |
Studio pages, same gate: GET /studio (home), GET /studio/onboarding (start), GET /studio/onboarding/step/{step} (a wizard step), GET /studio/onboarding/bundle (the generated bundle, a zip attachment: built only when Steps 1–3 are complete and the stored draft passes every step’s validation again, re-run as a submission runs it; otherwise 303 to the first step that is not, #2353).
Quarantined-envelope worklist (#2061)
api/ops_quarantine.rs (copy in api/ops_quarantine/copy.rs) is the worker surface over canopy-eligibility’s quarantined envelopes (canopy-eligibility › Quarantined envelopes).
-
Gate. Both routes refuse, with a 403 fragment and no upstream call, a worker whose
WorkerRole::is_determination_operatoris false. For a single role that is exactlycanopy_auth::DETERMINATION_OPERATOR_ROLES(eligibility_specialist,supervisor,admin); with several roles the portal’s role precedence can only narrow it. The resolve also takesWritePermission. -
Bearer. canopy-eligibility’s quarantine routes admit a worker at
DETERMINATION_OPERATOR_ROLES, so both routes call it on the worker’s delegation. A delegation that cannot be minted renders the worklist’s error state, or refuses the resolve 502 with nothing changed. -
Worklist. One page of 50, keyset-paged (Next page / First page), scoped query-time by the worker’s
programs=storage slugs. A captioned table: the full envelope id (the row header), program, reason, the claimed status headed Claimed status (unverified), the received time in the jurisdiction’s named zone, an Open case link, and a form per row with an Action fieldset (Re-verify / Dismiss) and a required note (1–500 characters). A failed read shows the error state, never an empty list; no rows shows the empty state. -
Resolve. The handler parses the typed envelope id and action (422 otherwise), re-reads the envelope (
GET /v1/eligibility/quarantined-determinations/{id}), and authorizes its program all-of against the worker’s scope (403x-canopy-denial: program-scopeout of scope). Only then does it post the resolution. Every upstream refusal maps by status and code to server-owned copy, and upstream text is never echoed: 403, 404, 422invalid_noteand each known 409 code get their own copy; a 409 with an unrecognized code renders generic copy at 409; anything else (a transport failure, a 5xx, an uncoded 409, another 422) is a 502. -
Notices. Success answers 303 to
/ops/quarantined-determinations?notice=…with one notice from a closed vocabulary:dismissed,reverified(a determination of record, recorded on its application),reverified-unrecorded(a determination of record that the application did not show within the projection wait; canopy-applications records it on its own),already-reverified(nothing changed), andstill-quarantinedwith its newreason. Any other query value renders no banner. -
Read-back. canopy-applications records a promotion on its application from eligibility's verdict (#3202). A promotion canopy-eligibility answered
201 Createdfor (this request wrote it) is read back from the application (Read after a determine): projected landsreverified, pending landsreverified-unrecorded, and a refusal renders as a 409 fragment with the refusal copy (the envelope is a determination of record, but the application did not record it). A200 OKreplay of an earlier promotion reads nothing back. The action writes nothing to canopy-applications.
Read after a determine
canopy-web never writes an application's determination (#3202): canopy-applications projects it from canopy-eligibility's determination.recorded.<program> verdict. After a determine returns, approve_application, run_determination and the quarantine promotion call await_projection (src/api/determination_projection.rs), which reads GET /v1/applications/{id} on the worker's delegation, every 150 ms, until each program the response names a terminal determination for carries one of that response's determination ids in determination_id (the sibling rule picks which), or a record_back_refusal naming one, or projection_wait_ms (CANOPY_WEB__PROJECTION_WAIT_MS, default 1000) runs out. A response that names no terminal determination waits for nothing. Three renders follow:
-
Projected — the action's success: the run's recomputed banner (or its redirect), the approve's redirect to the case, the promotion's
reverifiednotice. -
Refused — the #1707 copy, built server-side from the row's refusal
code(refusal_copy): the run's failed-run alert, the approve's action-error fragment, the promotion's 409 fragment. -
Pending — the wait ended first: a status alert, "Determination recorded.", saying the application will show it shortly (run and approve), or the promotion's
reverified-unrecordednotice. It is never reported as a failure.
A determine that outlives determine_timeout_ms answers the still-running alert, which says the run may still finish and that its outcome appears on the application when it does (#3199); no re-run is asked for.
Held-determination worklist (#3127)
api/ops_held.rs (copy in api/ops_held/copy.rs, view model in api/ops_held/page.rs, template templates/ops/held_determinations.html) is the worker surface over canopy-eligibility’s held determinations: determinations a program service made that canopy-eligibility never recorded, whose events the service still holds past its warning age (canopy-eligibility › Held determination events, ADR-002 Amendment 8). It mounts from its own builder, ops_held::routes(), which api::routes() merges.
-
Gate. Every route refuses, with a 403 fragment and no upstream call, a worker whose
WorkerRole::is_determination_operatoris false. The two actions also takeWritePermission. -
Program scope. canopy-eligibility’s held routes admit any determination operator and check no program, so canopy-web holds the worker’s scope. The selector offers only the worker’s programs. A
programoutside the scope is the view gate’s 403 (x-canopy-denial: program-scope), and an unknown one its 422, before any read. An action authorizes the re-read hold’s own program all-of, never the form’s. -
Bearer. Every call rides the worker’s delegation. A delegation that cannot be minted renders the worklist’s error state, or refuses the action 502 with nothing sent.
-
Worklist. A Program selector, then one page of 50, oldest first, keyset-paged (Next page / First page) on the cursor eligibility issued; a
nextthat is not such a cursor is not linked. A captioned table: the full determination id (the row header), the program the service reports it under (chipon Medicaid’s list), the disposition, the operation id or a dash, the held-since time in the jurisdiction’s named zone, the held event count, and the action. Anadoptablehold offers an Adopt and a Drop events form, adrop_onlyhold Drop events alone; each form is a labelled fieldset with a required note (1–500 characters). Arecorded,resolvedorquarantine_openhold offers no form, only a note on why; the quarantined one links/ops/quarantined-determinations. A failed read shows the error state, never an empty list; no rows shows the empty state. -
Actions. The form carries the listed program, the page cursor, the determination id and the note. The handler parses them (422 for a malformed id or cursor), re-reads that one page, and finds the determination on it (409 when it is no longer there). It authorizes the hold’s program, then posts. Adopt posts
{note}to the operation the re-read hold reports; a hold that reports none is a 409 before any write. Drop posts{program, note}with the hold’s own program. Neither body names a household. -
Refusals. Every upstream refusal maps by status and code to server-owned copy (
copy::refusal_copy), and upstream text is never echoed: 403, 404 (an adoption of an operation eligibility has no record of), 422invalid_note, 502program_unavailable, and each 409 code either route documents get their own copy. A 409 with an unrecognized code renders generic copy at 409; anything else is a 502. -
Notices. Success answers 303 to the same program and page with
notice=adoptedornotice=dropped. Any other value renders no banner. A dropped hold readsresolveduntil the program service’s verdict consumer deletes its events, then leaves the list.
Security administration
admin_security.rs (admin_security::routes(), mounted in the protected router) is a security administrator’s surface over canopy-security’s admin routes (canopy-security API), called through canopy-auth’s AdminClient on the worker’s delegation for canopy-security, which canopy-security admits only for security_admin (ADR-049 Amendment 20).
-
Gate. Every route takes
admin_security::SecurityAdminOnly, which admits a session holdingsecurity_adminwhatever its case role, and answers the 403 page, calling nothing, otherwise. The nav’s Security administration link is shown to exactly those sessions (base.html, both copies;NavRole::security_admin). -
Reads render the page; an admin error renders fixed copy at its status (403, 404, 409, 422, 429, else 503).
-
Writes parse the form’s
reason(1–200 bytes, no control character) and the path’s id into canopy-auth’s checked types before anything is sent: a refused one answers 422 (reason, upstream pair, id in a form) or 400 (an id in the path), echoing nothing. A form whose bytes or percent-escapes are not UTF-8 answers 400 before it is parsed, and one over 16 KiB 413 (AdminForm). A write canopy-security recorded answers303back to its page with?notice=from a closed set (created,suspended,lifted,revoked,linked,key_revoked,client_disabled,client_enabled, orunchangedwhen nothing changed). One canopy-security answeredinsufficient_user_authenticationanswers the handoff page to/auth/step-up?return_to=<the page>.
| Method | Path | Does |
|---|---|---|
GET |
|
Lookup form; |
GET |
|
Create form |
POST |
|
Create, unlinked; a blank id is minted (UUID v7) |
GET |
|
Links, suspension, sessions |
POST |
|
Suspend |
POST |
|
Lift the suspension |
POST |
|
Revoke a session; the form’s |
GET |
|
Re-link form ( |
POST |
|
Link or re-link an upstream identity to a subject |
GET |
|
Signing keys whose publish window has not ended |
POST |
|
Revoke a key |
GET |
|
Every compiled client and its state |
POST |
|
Disable a client at runtime |
POST |
|
Lift a client’s runtime disablement |
Device approval
device.rs (device::routes(), mounted in the protected router) is where a worker approves canopy-cli’s device flow (RFC 8628) and revokes the devices they approved (ADR-049 Amendment 21). Every route takes device::ApproverSession: any admitted session.
-
Code entry.
POST /deviceasks canopy-identity to describe the device the code names, through canopy-auth’sNativeSessions, for the confirm page;POST /device/denydenies it. A code that does not parse and one canopy-identity knows no device for show the one message, 422; too many codes show canopy-identity’s wait, 429. -
Approval.
POST /device/approvestarts a step-up sign-in whose grant is the device’s alone: adevice_approvalflow (themax_agestep-up options) naming the worker’s web session, answered with the handoff page to the upstream. The sign-in callback completes it for that web session, served by its id because the upstream’s return carries noSameSite=Strictcookie, keeps the device’s native session inweb_native_session, and hands off to/device/approved. A stale step-up restarts once withprompt=login; a code canopy-identity refuses, or a step-up signed in as someone else (approver_mismatch), renders the sign-in page with its refusal and keeps nothing. -
Revocation.
POST /device/sessions/{id}/revokerevokes the worker’s own device (its native session and upstream grant both) and answers303to/device/sessions?notice=revoked; a device that is not the worker’s answers 404 before anything is revoked. -
Upkeep. Every replica sweeps the native sessions every 30 s (
device::spawn_native_sweep), re-federating each from its own grant.
| Method | Path | Does |
|---|---|---|
GET |
|
Code form ( |
POST |
|
Describe the device, then the confirm page |
POST |
|
Deny it |
POST |
|
The step-up’s handoff to the upstream |
GET |
|
The approval landed |
GET |
|
The worker’s approved devices |
POST |
|
Revoke the worker’s own device |
The identity edge
canopy-auth’s EdgeForwarder forwards canopy-identity’s public routes to canopy-security’s internal URL: POST /identity/token, POST /identity/revoke, POST /identity/device_authorization, GET /identity/jwks and GET /.well-known/oauth-authorization-server/identity. They are merged outside the session and CSRF layers, since their callers (canopy-cli, machine clients) carry their own credentials, and under the per-IP limit. The forwarder sets X-Forwarded-For to the client CANOPY_TRUSTED_PROXIES resolves (the ingress in front of canopy-web).
Other routes
Mounted in main.rs outside the protected router.
| Route | Description |
|---|---|
|
The sign-in page (AC-8): the jurisdiction’s system-use notice ( |
|
Starts a sign-in: a |
|
Starts a step-up of the live session: a |
|
Takes the flow its cookie names, once and only with that flow’s own |
|
Sign-out (#2517), CSRF-checked: the |
|
canopy-identity’s public routes, forwarded by |
|
Liveness probe — the static |
|
Readiness probe — canopy-api’s |
|
Jurisdiction theme stylesheet, served as a real stylesheet for strict CSP. |
|
OpenAPI JSON for the composition surface only ( |
|
Static assets ( |
test-clock routes |
|
anything else |
|
Error codes
| Status | Meaning |
|---|---|
200 |
Page or fragment rendered (action refusals rendered as the inline |
204 |
Composition DELETE succeeded or was an idempotent no-op |
303 |
Action redirect back to the originating page; |
400 |
Malformed action form or missing required field ( |
401 |
No session on a composition JSON request |
503 |
The session store could not be read or a stale session’s maintenance outlasted the page budget (any protected route, |
403 |
Session / CSRF / write-permission / role / program-scope / binding refusals (see Authorization model) |
404 |
Unknown route, unknown household or application (including the empty participation union), unknown composition surface, |
412 / 428 |
Composition write precondition failed / missing |
415 |
PATCH against a dashboard composition surface ( |
422 |
|
422 |
Composition |
429 |
Per-IP rate limit exceeded |
500 |
Composition loading or template render failed; a refused fact write whose audit event could not be staged ([refused-fact-writes]); on the deadline-covered routes an upstream data failure renders the degraded state instead (the two audit-log downloads, the continuations panel and the two process-panel fragments answer 502 — see the 502 row) |
502 |
Fail-closed fragments and proxies whose upstream authority could not be read (continuations panel, the process page's reopen and postponement panel fragments, rep history, document content) |
Backend service clients
clients::ServiceClients (clients.rs) carries one InternalClient per upstream. serve_session binds a request’s roster to its outbound, so every call carries the worker’s delegation for its target; attributed writes obtain an AuthorizedClient from an authorization proof. The panel cache keys each entry by service, URL and the worker’s subject (#2647), so one worker’s cached read is never served to another.
| Client | Used for |
|---|---|
|
households, members, fact claims (income / asset / expense / address) |
|
queue and lists, processing, intake sections, documents, interviews, denials, pends, reopen and postponement records, representatives, the ops drain |
|
run-determination, case status, cross-program alerts, determinations, the quarantine worklist and resolve, the held worklist, adopt and drop |
|
verification requests, cancels, dashboard panel feeds |
|
enrollments, issuance, adverse actions, continuations |
|
ABAWD, work registrations, work sanctions, discrepancies, overpayment recompute, SNAP parameters |
|
work activities, discrepancy resolution |
|
CMD ingest |
|
authorization updates, provider switch, parent activities, child care needs |
|
household appointments, nutritional-risk assessments, breastfeeding statuses |
|
certifications, interim contacts, change reports, nudges |
|
notice history, PDFs, document render, palette search |
|
filing, decisions |
|
audit events, fact history, the worker directory sink |
|
reporting reads (cross-program by design) |
Security
-
Strict CSP — no
'unsafe-inline'or'unsafe-eval'(csp.rs; Alpine.js CSP build, nonce-based styles). -
CSRF token on every state-changing HTML request (
csrf::csrf_middleware); the composition JSON sub-router relies onSameSite=Strictinstead. -
Session cookie
__Host-canopy_session,HttpOnly,Secure,SameSite=Strict(load-bearing — the CSRF control for/v1/composition; never downgrade to Lax / None without adding a token layer there —web_session/cookie.rs). The cookie carries a 256-bit random token; the store holds only its SHA-256 (#2518). -
Per-IP rate limiting (
canopy_api::apply_rate_limit_redis): a replica-aware Redis fixed window whenCANOPY_WEBRATE_LIMIT_REDIS_URLis set, degrading to the process-local governor on Redis failure — never to unlimited; rpm viaCANOPY_WEBRATE_LIMIT_RPM(#1227). -
Outbound calls present the worker’s delegation for their one target (ADR-049); the session’s credential never leaves the BFF. Each receiving service admits the delegation by the route’s compiled admission (ADR-049 Amendment 14).
-
Fail-closed admission (ADR-044): no session without canopy-identity’s federation, a recognized role and a usable program scope; every serve re-admits the session as canopy-identity last federated it, and a session that no longer admits is served as none.