WIC certification expiration and the advance expiration notice (epic &106, Plan B2)
Status: Done (2026-09-28) — !1530, !1531
Issues: #2390 (epic &106; split from #2360), #2431, #2432
Branches:
-
MR-1, the consumer half:
feat/2390-wic-expiration-notice-routes. It carries this page. -
MR-2, the producer half:
feat/2390-wic-certification-expiration.
This is a Design + Scope plan. GitLab owns tracking. It freezes when the first unit starts. It builds on B1 (#2389): typed routable WIC events, and the WIC notice identity in canopy-notices.
Erratum (2026-09-28): D5’s addressing is caretaker_for_minor, not responsible_adult_for_minor: 7 CFR 246.7(j)(8) owes the notice to the participant, parent or caretaker at any age, and the adult-only rule left a minor parent and her infant unnoticed.
Context
-
A granted WIC certification never ends. Nothing writes
expired(crates/canopy-contracts-wic/src/participants.rsnames #2390 as its writer). canopy-wic runs no background task and binds no queue (services/canopy-wic/src/main.rs), though its inbox tables exist. No participant is warned before a certification lapses. -
The law:
-
7 CFR 246.7(j)(8) (restated in
docs/modules/ROOT/pages/federal-requirements.adocby B1): "notified not less than 15 days before the expiration of each certification period". There is no fair-hearing clause, since an expiration is not an adverse action. -
DPH CT-840.01 (pinned corpus): 15 days, 30 for a homeless participant.
-
7 CFR 246.2 defines a homeless individual. That text sits only in the DPH corpus (NS-210.11), not in any federal source.
-
-
No homeless fact exists for WIC. The only one is SNAP/TANF’s
SpecialCircumstancesPayload.homeless(crates/canopy-contracts-applications/src/sections.rs). The only builders ofWicApplicationContextare canopy-wic, its tests andcrates/canopy-test-lib/src/clients/wic.rs. -
No retained WIC record exists. WIC is outside the SNAP-only September 2026 UAT, and canopy has no production deployment. The only rows are canopy-seed demo fixtures and test rows.
-
Precedents:
-
the enrollment expiry sweep (
services/canopy-enrollment/src/expiry_sweep.rs): keyset paging, a time budget, one transaction per row with WARN-and-continue, and the manual triggerservices/canopy-enrollment/src/api/expiry_sweep.rs(200 or 202); -
the unfenced advisory-locked retry loop (
services/canopy-appeals/src/cb_stay.rs); -
the renewals notice of expiration:
-
staging (
services/canopy-renewals/src/scheduler.rsstage_drain_noe: a pre-minted envelope id, stamped and staged in one transaction); -
dispatch evidence (
services/canopy-renewals/src/noe_dispatch_subscriber.rs); -
retraction (
services/canopy-notices/src/noe_superseded.rs, four arms keyed onsource_event_id);
-
-
the #1941
regarding_nameoverlay for a redirected addressee (services/canopy-notices/src/generator.rsassembled_program_data) and its render pinthe_noas_print_a_regarding_line_only_for_a_redirected_addressee.
-
-
Defects this plan must fix:
-
Appeal rights (#2431).
persist(services/canopy-notices/src/generator.rs) creates an appeal-rights row for every notice. YetNoticeWithAppealRights.appeal_rightsis "None for non-adverse notices" (crates/canopy-contracts-notices/src/notices.rs), and 12 templates per ruleset print no hearing box, SNAP’s interview appointment and NOMI among them. No other service reads the row. -
Early retractions (#2432).
noe_superseded.rsarm 4 acks a retraction whose letter is not yet staged, so a retraction that overtakes its due event is lost.
-
-
Constraints:
-
Quality budget B1 is at its lock of 17, with
services/canopy-wic/src/api/handlers.rsat 460 lines andservices/canopy-wic/src/api/persist.rsat 484. New code gets its own files. -
B8 is at its lock of 8, so the tick reads
unwrap_or_else(canopy_common::clock::now). -
[wic.certification]refuses non-category keys. -
run_window_fencedconsumes its window on anyOk(crates/canopy-db/src/window_fence.rs). -
Binding-first deployment (
docs/modules/ROOT/pages/event-delivery-protocol.adoc): a queue’s new keys deploy before their producer.
-
Rulings in force: pre-1.0, no shims; every jurisdiction without code changes; ADR-004 (ids, codes and dates only on the bus); ADR-011 (every pack key cited); neutrality; the maintainer’s in-workstream ruling on related defects.
Scope
In scope: D1–D7.
Out of scope:
-
capturing
homelessat intake: the orchestrator does not dispatch WIC (#2364), and the capture gap is #858; -
#2372 (seed ends from the period engine);
-
termination (B3 #2391), cessation (B4 #2392) and temporary certification (B5 #2393). B3 reuses D7;
-
recording a verbal expiration notice (CT-840.01 allows one).
Design
| # | Decision |
|---|---|
D1 |
The homeless input (MR-2).
|
D2 |
Lead days as pack data, held to a federal floor (MR-2).
|
D3 |
The lifecycle sweep (MR-2;
|
D4 |
Dispatch evidence and supersession (MR-2).
|
D5 |
The notice (MR-1).
|
D6 |
Appeal rights follow the letter (MR-1, #2431).
|
D7 |
Retraction (MR-1).
|
Invariants
-
A certification is expired only by the sweep, only past its end, and only while still current.
-
A current certification’s notice is staged at most once; its stamp and staged event commit together. It counts as sent only on dispatch evidence.
-
An undispatched notice of a superseded certification is retracted, whether it is queued, rendered, or not yet staged.
-
A notice has an appeal-rights row exactly when its letter prints a hearing box.
-
No lead is below the federal floor or above a year, and the homeless lead is never shorter than the ordinary one.
Units
MR-1 merges and deploys (cargo xtask dev reload) before MR-2’s WIC activates, so both notices bindings exist before any WIC publish (binding-first). Each commit carries its CHANGELOG bullet.
MR-1: consumer half (Relates to #2390; Closes #2431, #2432)
-
docs(plans): plan WIC certification expiration (#2390): the page and its nav line. -
U-N1 (w2)
fix(notices): persist appeal rights only for letters with a hearing box (#2431).-
Files:
crates/canopy-typst/src/{manifest.rs,context.rs},services/canopy-notices/src/generator.rs,rulesets/{georgia,default}/notices/manifest.toml,docs/modules/ROOT/pages/api/canopy-notices.adoc. -
Tests:
every_template_entry_declares_the_hearing_rights_its_file_renders(both rulesets);a_letter_without_a_hearing_box_persists_no_appeal_rights(ephemeral schema, read back asNone). Existingnotice_write_success_persists_notice_and_appeal_rightsstays green.
-
-
U-N2 (w2)
fix(notices): hold a retraction that arrives before its notice (#2432).-
Files: a
notice_retractionsmigration,services/canopy-notices/src/{noe_superseded.rs,work_items.rs}andwork_items::insert's callers. -
Tests:
a_retraction_before_staging_suppresses_the_letter;a_retraction_racing_its_staging_waits_then_retracts(two connections; the staging holds the lock uncommitted).
-
-
U-B (w3)
feat(notices): route and retract the WIC advance expiration notice (#2390).-
Files:
crates/canopy-contracts-wic/src/{events.rs,lib.rs},crates/canopy-reference/src/cross_program.rs, both manifests and templates,services/canopy-notices/src/{generator.rs,event_routing.rs,noe_superseded.rs},docs/modules/ROOT/pages/api/canopy-notices.adoc. -
Tests:
-
the route count moves from 55 to 56;
-
the responsible-adult pin is renamed and gains the route; the letters-without-addressing assertion becomes 48 − 3;
-
the route joins
both_ruleset_route_cases(), withcertification_endforwarded; -
the_wic_expiration_notice_names_the_child_only_when_redirected, both rulesets, asserting no hearing box; -
a persisted WIC expiration notice has
appeal_rights = None; -
WIC retraction arms: stage → supersede → dispatch for a queued item, and for a rendered-but-undispatched notice the dispatcher’s claim no longer returns;
-
an unrecognized key parks;
-
default_program_data_is_a_map_of_every_placeholder_family; -
wire pins for the three V1 events.
-
-
MR-2: producer half (Closes #2390)
-
U-A (w6)
feat(wic): expire certifications and stage the advance notice (#2390).-
Files:
-
services/canopy-wic/{migrations/<next>_wic_lifecycle.sql,src/lifecycle.rs,src/lifecycle_sweep.rs,src/notice_dispatch_subscriber.rs,src/api/lifecycle_sweep.rs,src/api/mod.rs,src/api/persist.rs,src/main.rs,src/params.rs,src/events.rs,src/determine.rs,src/store/participants.rs,src/store/models.rs,tests/wic_test.rs}; -
crates/canopy-contracts-wic/{src/determine.rs,src/participants.rs,src/lifecycle_sweep.rs,src/paths.rs,src/lib.rs,tests/roundtrip.rs}; -
crates/canopy-test-lib/src/clients/wic.rs; -
tools/canopy-seed/src/{model.rs,datagen.rs,sql.rs}; -
rulesets/federal/{wic-lifecycle.json,citations.toml,indexing.toml,README.adoc}; -
rulesets/{georgia,default,test-max}/{jurisdiction.toml,citations.toml}; -
compliance/input-requirements/wic.toml; -
services/canopy-eligibility/{src/mappers/mod.rs,tests/orchestrator_dispatch_test.rs}; -
devstack/rabbitmq/definitions.json,xtask/mq-topology-allow.toml; -
the compliance rows (below);
-
docs/modules/ROOT/openapi/wic.json.
-
-
Compliance:
-
wic.certification.certification-expiration-notificationbinds askind = "system-job", componentservices/canopy-wic/src/lifecycle_sweep.rs, test_reftwo_passes_are_idempotent; its allowlist entry is removed. -
The scenario
wic.certification.certification-expiration-advance-noticebinds that test too and keepsblocked_by = ["#826"](its journey carries benefits on). The #2390 fence is dropped, and it stays Partial. -
The
compliance/action-catalogue/wic.tomlGAP comment "WicApplicationContext has no homeless/migrant/disaster flag" is restated: homeless exists now; migrant and disaster remain gaps.
-
-
Tests:
-
lifecycle.rs:lifecycle_keys_parse_and_refuse_below_the_floor_or_misordered. It covers four packs, a missing table, an unknown key, 14, 367, and a homeless lead below the ordinary one. -
Sweep
infra_tests(ephemeral schema, injectedas_of):-
the_notice_leg_stamps_and_stages_once_per_row(envelope id = stamp); -
a_homeless_participant_is_noticed_at_the_longer_lead; -
a_row_first_seen_after_its_lead_is_staged_late_with_a_warn; -
the_expire_leg_expires_only_current_rows_past_their_end; -
a_superseded_record_is_not_expired; -
two_passes_are_idempotent; -
keyset_crosses_page_boundaries; -
a_budget_stopped_pass_is_finished_by_the_next_probe_the_same_dayanda_failed_row_is_retried_by_the_next_probe_the_same_day, both throughrun_lifecycle_sweep_lockedat oneas_of; -
manual_trigger_skips_while_the_lock_is_held; -
overdue_and_undispatched_expiries_are_counted; -
legal_day_rollover_pins.
-
-
Dispatch subscriber:
a_dispatch_stamps_its_certification_once,a_late_dispatch_warns,a_foreign_notice_type_is_ignored,an_unknown_correlation_warns. -
store/participants.rs(ephemeral schema):homeless_round_trips_through_the_record;superseding_an_undispatched_notice_returns_its_event_id;a_dispatched_notice_is_not_returned_for_retraction. -
services/canopy-wic/src/api/persist.rs: the retraction event is staged in the supersede transaction. -
Live (
wic_test.rs):wic_lifecycle_sweep_expires_a_lapsed_certification. It determines with a pastas_ofwhose computed end precedes the legal today, retriestrigger_lifecycle_sweepthrough 202, and GETs the record asexpired. It never moves the clock, which 38 live tests share (#2140), and it notes the pass is fleet-wide.
-
-
-
U-C (w1)
docs: document WIC certification expiration (#2390):-
api/canopy-wic.adocanddata-models/canopy-wic.adoc; -
rulesets.adoc([wic.lifecycle]and the floor file); -
authorization-inventory.adoc; -
federal-requirements.adoc: the 246.7(j)(8) row’s "not implemented" cell; -
CHANGELOG.adoc(Changed:homelessis a required determine field, a pre-1.0 wire change).
-
-
docs(plans): close the WIC certification expiration plan (#2390).
Verification
-
Per unit, in isolated worktrees:
-
fmt, workspace clippy with the portal features, and
cargo docwith broken intra-doc links denied; -
the non-live lanes, and the ephemeral-schema tests filtered by name;
-
quality-budgets, neutrality-lint, migrations-lint, determination-status-lint, the policy audit and action-coverage, scenarios audit, test-lanes-lint.
-
-
Per MR, on its branch:
-
mq-topology;
-
CANOPY_CARGO_FEATURES=canopy-api/test-clock cargo xtask dev reload; -
cargo xtask api-docs --update, then input-coverage (MR-2: manifest v4 against the regeneratedwic.json); -
git push.
-
-
MR-2 is rebased on main after MR-1 merges and deploys.
Deploy note: MR-2’s first pass expires every seeded current certification past its end, and stages late notices for those in their lead window (#2372: the seed’s dates are fixed).
Documentation Updates
-
The pages in U-N1, U-B and U-C.
-
GitLab:
-
file #2431 and #2432 at approval;
-
add "WIC homeless status" to #858’s checklist;
-
after MR-2 merges, close #2390 and repoint its plan link.
-
Review log
| round | vendor | resolved model | verdict |
|---|---|---|---|
1 (2026-09-28) |
Anthropic |
claude-opus-5-5 |
no-ship. Three blockers fixed: * full paths for every cited file; * the live test determines in the past instead of moving the shared clock; * U-C updates the (j)(8) row, and the homeless GAP comment is restated. Observations folded in. |
2 (2026-09-28) |
OpenAI |
gpt-6-astra |
no-ship. Seven findings fixed:
* hourly locked passes replace the daily fence, so incomplete passes retry;
* two MRs, binding-first;
* supersession retraction (D7, plus arm 4 #2432);
* staged vs dispatched evidence, with overdue handling;
* the |