Day-30 Procedural Disposition — Enforce Cutover & Operations

For an operator flipping canopy-applications from shadow to enforce for the SNAP day-30 disposition drain (7 CFR 273.2(h)(1)–(3); PAMMS SNAP 3105:334-336 business-day shifts, :599 / :601 verification purpose split). Design: SNAP intake completion (#788). Settings are AppConfig fields in services/canopy-applications/src/config.rs; the drain is the canopy-applications.day-30-disposition scheduler leg (services/canopy-applications/src/scheduler.rs).

What the drain does

Every legal day the leg scans SNAP program rows whose mutable operational clock (current_workflow_deadline) has arrived — terminal statuses excluded by DAY30_SCAN_SQL (store/day30.rs) — and judges each against the disjoint day30_policy truth table (default: agency fault). The judgment always lands in day30_shadow_findings, one upserted row per application, program and legal day. What else happens is CANOPY_APPLICATIONS__DAY30_MODE (day30_mode, default off):

Mode Effect

off

The leg is absent from the default sweep; a named request refuses 422 day30_disabled (api/scheduler.rs). Nothing is written.

shadow

Classify and ledger only (applied = 'shadow'). Nothing is denied, pended or lettered.

enforce

The arms are applied. Household-fault arms → a system administrative denial with the reopen-rights letter (noa-denial); agency-fault arms → an (h)(3) pend episode (operational clock extended by snap_standard_days, the agency-pending letter). The separate canopy-applications.expedited-downgrade leg stamps expedited_downgraded_at on rows whose expedited window passed. The ledger’s applied column records applied / deferred / cutoff_deferred / skipped per row (20261219000000_day30_enforce.sql).

A postponement release also resets the mutable clock (release legal day
snap_standard_days); the immutable standard_processing_deadline never moves, so the cutoff comparison below is unaffected.

Preconditions

  • enforce refuses to boot without CANOPY_APPLICATIONS__DAY30_ENFORCE_CUTOFF_DATE (YYYY-MM-DD) and without the canopy-persons service identity (services/canopy-applications/src/main.rs): letters are mandatory; an unresolvable recipient defers the arm.

  • The verification batch-context read (POST /v1/verifications/batch-context, crates/canopy-contracts-verification/src/paths.rs) is live — the verification arms are fail-closed without it.

  • nomi_dispatched_at is stamped by the NOMI dispatch (20261129000000_nomi_dispatched_stamp.sql) — the missed-interview arm requires a dispatched notice.

  • The reopen-rights denial letter (snap/noa-denial.typ) and denial_reopen_window_days (the georgia pack’s jurisdiction.toml) are in place.

  • Every notices manifest routes application.pending_agency_delay → agency-pending (the georgia pack’s notices/manifest.toml; consumer-first — the producer parks nothing).

Steps

  1. Shadow window. Run shadow for N legal days (Georgia UAT: at least five business days including one weekend). Sign off a sample from GET /v1/applications/day30-shadow-findings or the supervisor page /ops/day30-shadow: every deny_* arm carries its evidence (interview id / verification ids) and a would_execute_on that is a business day; every pend_* arm is agency-fault on inspection. Record the sign-off in the flip MR.

  2. Cutoff. Set CANOPY_APPLICATIONS__DAY30_ENFORCE_CUTOFF_DATE to the flip’s legal day. The first enforce tick dispositions only rows whose immutable standard_processing_deadline is on or after the cutoff; older overdue rows are recorded cutoff_deferred every tick and surface on the report — workers disposition those by hand with the per-application denial and pend actions, never the drain.

  3. Canary. Set CANOPY_APPLICATIONS__DAY30_MODE=enforce and restart canopy-applications on the lowest-volume legal day, after the weekend shift lands (a Monday flip executes the weekend’s SOPs on Monday per 3105:334-336). Watch the first tick’s counters in the log line day-30 disposition leg ran (examined / staged / skipped / warned) and the ledger’s applied distribution.

  4. Metrics, every tick.

    SELECT arm, applied, count(*) FROM day30_shadow_findings WHERE run_day = <day> GROUP BY 1, 2;

    deferred rows clear on the next tick (business-day shift, recipient resolution, a lost or raced reservation); one that persists past two ticks is an incident — check the applications WARN log for the row. Rows the ledger cannot show — a page whose batch-context read failed (never a judgment on unread evidence) or an apply step that errored — surface only as the tick’s warned counter and the WARN log.

Verify

A healthy enforce tick shows only applied, deferred, cutoff_deferred and skipped in applied; every applied deny row has a dispatched noa-denial and every applied pend row an agency-pending letter on the case’s Notices tab plus an extended operational clock. A kind_deferred value in a fresh row means a stale binary is ticking (History).

Rollback (also the kill switch)

Set CANOPY_APPLICATIONS__DAY30_MODE=shadow (or off) and restart canopy-applications. Ledger rows are retained and no disposition is undone: applied denials remain lawful administrative denials, curable through the reopen right on the letter; applied pends keep their extended clock. The migration 20261219000000_day30_enforce.sql is additive — no schema rollback.

Operational notes

  • Reservation. Each disposition claims the row (application_programs.disposition_reserved_at, RESERVATION_LEASE_SECS = 15 min, store/day30.rs) before the recipient read, re-verifies claim, row status and interview premise under a row lock in the apply transaction, and clears it on every non-error exit. A claim older than the lease is reclaimable, so a tick that died mid-row cannot wedge it.

  • Idempotency. The system denial’s idempotency key is a pure function of (application, operational clock): a re-tick after a partial failure replays with zero side effects; a later episode (a different clock after a pend) is a new denial.

  • Re-pend. A pended row whose extended clock arrives with the agency still at fault is pended again (new episode, new letter, WARN in the log) — investigate repeated re-pends per application; with household fault now proved it is denied on that clock.

  • Expedited downgrade is enforce-only, never a denial, never moves a clock and is not cutoff-gated: the cutoff governs dispositions, and the downgrade is a processing-track fact with no adverse effect.

  • Basis variant. The agency_fault_pending effective-date basis (crates/canopy-types/src/effective_date_basis.rs) ships fleet-wide as a tolerated variant (an unknown kind is a hard deserialization error at typed consumers).

NOTE
History — kind_deferred was #1728’s recertification fence, lifted by #1729 (pend arms) and #1730 (deny arms, kind-aware reopen_deadline_date, 7 CFR 273.14(e)); no arm emits it and the day30_recert_deferred metric is retired, so a fresh one means a stale binary; pre-#1729 rows are expected history. Since #1730 a recertification verification_not_provided denial before the interview is satisfied answers 422 interview_not_satisfied.
Edit this page · default