WIC mid-certification termination: reassessment, scheduling and notice (epic &106, Plan B3)
Status: Done (2026-09-29) — !1534, !1535, !1536, !1538, !1540
Issues: #2391 (epic &106), #2445, #2446, #2447, #2448, #2449
Branches:
-
MR-P:
fix/notices-dispatch-integrity, a prerequisite of MR-2. -
MR-0:
feat/2391-wic-income-reassessment. It carries this page. -
MR-1:
feat/2391-wic-termination-notice-routes. -
MR-2:
feat/2391-wic-termination-scheduling.
Erratum (2026-09-29): MR-1 renamed services/canopy-notices/src/noe_superseded.rs to retractions.rs; the Context cite is corrected to as-built.
Erratum (2026-09-29): D4 as built adds two 422s: wic_reassessment_superseded (a covered member has an income_reassessment made after the cited run; partial index wic_determinations_reassessment_person) and idempotency_key_invalid (a blank, over-255-byte or NUL-bearing body key), and it re-reads the body key before the no-current-record 404.
Erratum (2026-09-29): D7 as built repairs to max(effective_on, new floor), never earlier than the termination’s date, and judges expires_first against that date; a same-date replacement letter still quotes the closed letter’s date.
This is a Design + Scope plan. GitLab owns tracking. It freezes when the first unit starts. It builds on B1 (#2389) and B2 (#2390). Plan B3-H follows it and closes #2391.
Context
-
The law.
-
7 CFR 246.7(h)(1)(ii): disqualify "a participant and any other household members currently receiving WIC benefits who are determined ineligible based on the mid-certification income reassessment". An adjunctively eligible participant may be disqualified "only after their income eligibility has been reassessed based on the income screening procedures used for applicants who are not adjunctively eligible".
-
(j)(6): written notice "not less than 15 days before" the disqualification, with the reasons and the right to a fair hearing.
-
246.9(e): at least 60 days to request a hearing, "from the date the agency mails or gives" the notice.
-
246.9(g): continued benefits for an appeal within the 15-day period (B3-H).
-
DPH’s Notice of Termination form (pinned, "Revised February 2023") and CT-860.04 VI.A.
-
-
Evidence exists. WIC determinations record typed
income_eligibleandadjunctive_eligibleresults (services/canopy-wic/src/determine.rs, migration20260413000000_create_wic_tables.sql).-
But every
POST /v1/determinerun re-certifies each member it finds eligible (determine.rs,store/participants.rspersist_certification). -
So an income reassessment needs a run that certifies nothing (D1).
-
-
Precedents:
-
enrollment’s adverse action (
services/canopy-enrollment/src/adverse_actions.rs: the printed date is fixed at scheduling, the route isverbatim, dispatch evidence gates, a late letter is repaired); -
B2’s lifecycle sweep, WIC dispatch consumer, supersession hook, retraction consumer and pinned notice types;
-
canopy-wic’s household route (
/v1/wic/households/{household_id}/appointments) andstore/participants.rsin_person_order.
-
-
Verified defects this program fixes:
-
#2446: a retraction can flip a delivery the dispatcher has already claimed. The letter is mailed, but its stamp misses (
services/canopy-notices/src/retractions.rs,worker.rs,store.rs). -
#2447: the notice date is fixed at render, not at dispatch, so a legal day crossed in the queue leaves 59 days (
generator.rs). -
#2448: canopy-wic stamps from
Utc::now()and SQLnow()(determine.rs,store/lifecycle.rs,store/participants.rs). -
#2449: B2’s WIC letter alters the USDA statement (
rulesets/georgia/notices/components/civil-rights.typagainst CR-1110.02).
-
-
Constraints:
-
Quality budget B1 is at its lock of 17 (
services/canopy-wic/src/api/persist.rsat 492 lines), and B8 is at its lock of 8. -
The global POST idempotency middleware replays 2xx responses byte for byte by header (
crates/canopy-api/src/idempotency.rs). -
[wic.lifecycle]denies unknown fields, andLifecycleParamsisCopy.
-
Rulings in force: pre-1.0, no shims; every jurisdiction without code changes; ADR-004; ADR-011; ADR-043 A1; neutrality; the in-workstream ruling on related defects.
Scope
In scope: MR-P and D1–D10.
Out of scope:
-
Plan B3-H: the appeal hold, the canopy-appeals arm, enactment,
wic.certification_terminated, and retracting an unsent expiration notice at enactment; -
continued benefits beyond the hold (#827);
-
sanctions (#827, #837) and missed pickups (#826);
-
a rescission letter after a dispatched cancellation, an explicit communication gap (#2451);
-
the canopy-web form (#2450);
-
Spanish rendering (#774/#836);
-
the DPH voucher line (#826);
-
a program_data snapshot for on-demand re-render (#2454).
Design
| # | Decision |
|---|---|
D1 |
Income reassessment determinations (MR-0, #2445).
|
D2 |
Pack data (MR-2).
|
D3 |
Schema (MR-2;
|
cancelled`; B3-H widens it), |
superseded |
expired |
expires_first`), |
D4 |
Schedule (MR-2;
|
D5 |
Cancel and list (MR-2).
|
D6 |
Locks, clock, helpers (MR-2).
|
D7 |
Dispatch evidence and the settle leg (MR-2; no enactment).
|
D8 |
Supersession (MR-2). The supersede UPDATE returns record columns only. Then lock the termination and the letter, and cancel as |
D9 |
The bus and the notice (MR-1; MR-2 publishes).
|
D10 |
Compliance (MR-2).
|
Invariants
-
No termination is scheduled without an income reassessment that found that member income- and adjunctive-ineligible, covering the whole household.
-
A record has at most one scheduled termination.
-
Each termination’s live letter is either on time, or replaced or cancelled on the next pass. No path leaves an unsent letter for a cancelled termination.
-
No termination date is within the lead of today plus slack, or within the expiration-notice window.
Units
MR-P first, or in parallel, before MR-2. Then MR-0 → MR-1 → MR-2. MR-1 merges and deploys before MR-2 publishes (binding-first).
-
MR-P (w4, Closes #2446 and #2447).
-
#2446 makes retraction respect the dispatch claim: arm 2 skips live claims; every arm writes
notice_retractions; claim, park and defer exclude retracted notices; a fence miss after provider acceptance logs ERROR; resend refusessuperseded. -
#2447 fences a legal-day crossing before
deliver(a terminalstalestatus, then re-render and resend), retiring the stale notice’s appeal-rights row. -
The tests are in the issues, including an interleaving test with a recording adapter and a test-clock day-boundary test.
-
-
MR-0 (w3, Relates to #2391, Closes #2445). The plan page, its nav line, and D1.
-
Tests: a reassessment run writes rows and changes no record; the envelope pin carries
purpose; a subject without a current record is 422. -
Docs:
api/canopy-wic.adoc,data-models/canopy-wic.adoc,CHANGELOG.adoc.
-
-
MR-1 (w3, Relates to #2391, Closes #2449). D9 contracts and constants, both manifests and templates, the retraction and correlation rows, the
retractions.rsrename, and the #2449 component.-
Files:
services/canopy-notices/src/{retractions.rs,event_routing.rs,generator.rs,manifest_checks.rs,main.rs},api/canopy-notices.adoc,CHANGELOG.adoc. -
Tests:
-
the route count moves from 56 to 57; letters minus 4; the renamed caretaker pin; a sixth route case;
-
both-ruleset renders: the reason, the dates, the phone and mail text, the prevail date equal to the stored deadline, no continued-benefits text, the tagline, the replacement line, an unknown reason refused;
-
the retraction arms and same-source isolation for the new key;
-
the correlation pins and wire pins;
-
a live test publishing both envelopes through the devstack broker and observing the letter and its retraction (binding evidence).
-
-
-
MR-2 (w8, Relates to #2391, Closes #2448). D2–D8, D10.
-
Files: canopy-wic’s migration,
lifecycle.rs,params.rs,api/terminations.rswith nestedapi/terminations/infra_tests.rs,services/canopy-wic/src/api/mod.rs,services/canopy-wic/src/api/persist.rs,api/persist/supersession.rs,determine.rs,store/{mod,terminations,participants,models,lifecycle}.rs,store/lifecycle/fixtures.rs,lifecycle_sweep.rs,lifecycle_sweep/infra_tests.rs,notice_dispatch_subscriber.rs,events.rs,main.rs,tests/wic_test.rs; the canopy-contracts-wicterminations,paths,lifecycle_sweep,participantsand roundtrip files; the test-lib client; the seed files and seedtests/integration.rs; the rulesets and citations; the ACL and topology allowlist; the D10 rows; a canopy-notices test that every pack’s reason codes render;wic.json. -
Tests:
-
pack refusals;
-
schedule: every answer; the two-layer replay (header against body key; replay after repair, cancel, a pack change and a date advance); concurrent same-key pairs, same and different household; a valid service token gets 403;
-
cross-participant and multi-pointer FK refusals in raw SQL;
-
cancel: uniform 404, idempotent, closes the letter;
-
list paging;
-
settle: an exact-boundary on-time letter; a late dispatch repairs with a replacement line; an undispatched letter repairs once it can no longer be on time;
expires_first; beyond one page with an exhausted budget; outbox rollback on schedule, repair and each cancel path; -
supersession after a repair retracts the new letter (
await_blocked); schedule against cancel, and cancel against repair, interleaved; -
the dispatch stamp; the status CHECKs and the cutover; seed rows expired;
-
live: schedule from a reassessment run, then list and cancel, in
wic_test.rs.
-
-
Verification
-
Per unit:
-
fmt, clippy in both profiles,
cargo docwith broken links denied; -
the non-live lanes and the named ephemeral-schema tests;
-
quality-budgets, neutrality-lint, migrations-lint, determination-status-lint, the policy audit and action-coverage, scenarios audit, test-lanes-lint.
-
-
Per MR: mq-topology;
CANOPY_CARGO_FEATURES=canopy-api/test-clock cargo xtask dev reload;cargo xtask api-docs --updateand input-coverage;git push. -
MR-2 is rebased after MR-1 has merged and MR-1’s live binding test has passed on the reloaded devstack.
-
Closing:
cargo xtask plan-lint --done, with--allow-openfor #2391 (until B3-H) and for each out-of-scope owner still open, before the nav moves to Archive.
Documentation Updates
-
The pages in each MR, plus
state-machines.adoc(the termination machine) and the canopy-wic row ofservices.adocin MR-2. -
GitLab: the issues are filed and the B4 question is on #2392.
Review log
| round | vendor | resolved model | verdict |
|---|---|---|---|
1 (2026-09-28) |
Anthropic |
claude-opus-5-5 |
no-ship. Five blockers fixed: the commit subject, the MR-1 CHANGELOG, a full-path cite, the lock order, and the idempotency identity. |
2 (2026-09-29) |
OpenAI |
gpt-6-astra |
no-ship; 38 findings, verified by an eight-cluster read-only workflow (most confirmed, some partial). The maintainer decided M1–M3 and M1.ii. The program was restructured: * notices integrity prerequisites #2446 and #2447; * a non-certifying reassessment with household cohorts and adjunctive evidence; * the hold and enactment moved to B3-H; * truthful provenance and cutover; * user-only guards, scoped cancel, keyset list; * two-layer idempotency; * per-row settle fencing and strict on-time rules; * adapted-form tests; * binding evidence; * the process fixes. |